Example 2144: Calculation of stripe data using user-defined polylines


The comfile run by this example is as follows:

#Example_2144  Exercise in using define data;calc stripe group ...                                                                  
#              1) Set up two groups of bezier polylines, each drawn in                                                              
#                 the same way (ie. same serial order of polylines, same                                                            
#                 direction of "head" to "tail")                                                                                    
#              2) Discretize the first group of polylines into a                                                                    
#                 prescribed number of points                                                                                       
#              3) Discretize the second group of polylines in the same                                                              
#                 number of points as the first group                                                                               
                                                                                                                                    
fem def window;c on 1                                                                                                               
fem def poly;m bezier      #repeat this step as needed [3 more times]                                                               
fem def poly;m bezier                                                                                                               
fem def poly;m bezier                                                                                                               
fem def poly;m bezier                                                                                                               
fem list poly              #list polylines                                                                                          
fem group poly 1..4  as firstgrp                                                                                                    
fem list poly group        #list polyline groups                                                                                    
                                                                                                                                    
#Next discretize this group of polylines into 150 data points                                                                       
fem def data;c stripe group firstgrp total 150                                                                                      
fem def data;w;example_2144_firstgrp geom                                                                                       
fem draw data                                                                                                                       
fem cancel data                                                                                                                     
fem cancel poly             #get rid of first group of polylines                                                                    
fem def poly;m bezier       #Draw a second set of [4] polylines                                                                     
fem def poly;m bezier                                                                                                               
fem def poly;m bezier                                                                                                               
fem def poly;m bezier                                                                                                               
fem list poly                                                                                                                       
fem group poly 1..4 as secondgrp                                                                                                    
fem list poly group                                                                                                                 
                                                                                                                                    
#Discretize this second group of polylines into 150 data points                                                                     
#The zero at the end signifies that parameters from previous call are reused.                                                       
fem def data;c stripe group secondgrp total 0                                                                                       
fem def data;w;example_2144_secondgrp geom                                                                                      
fem draw;add data                                                                                                                   
fem quit                                                                                                                            

Files used by this example are:

Name              Modified     Size

example_2144.com 22-Jun-2000 4.9k

Download the entire example:

Name                           Modified     Size

examples_2_21_214_2144.tar.gz 19-Aug-2006 1.4k

Html last generated: Sun Mar 6 05:50:08 2016

Input last modified: Thu Jun 22 15:28:11 2000


CMISS Help / Examples / 2 / 21 / 214 / 2144