Difference between revisions of "BRL-CAD Primitives"

From BRL-CAD
 
Line 1: Line 1:
 
Arbitrary Solid shapes are defined using "waterlines". The following figure consists of a start point, some number of intermediate polygons, and an ending point. Each of the intermediate polygons have the same number of vertices and the vertices are numbered 1 thru N. In addition to the intermediate polygons a line will be created that begins at the start point, goes through each polygon at its vertex numbered 1, and terminates at the end point. This is repeated for each polygon vertex 2 thru N. The start point, polygons, and end point are each a "waterline".
 
Arbitrary Solid shapes are defined using "waterlines". The following figure consists of a start point, some number of intermediate polygons, and an ending point. Each of the intermediate polygons have the same number of vertices and the vertices are numbered 1 thru N. In addition to the intermediate polygons a line will be created that begins at the start point, goes through each polygon at its vertex numbered 1, and terminates at the end point. This is repeated for each polygon vertex 2 thru N. The start point, polygons, and end point are each a "waterline".
 
+
<br><br>
 
<need an image here to illustrate the concept>
 
<need an image here to illustrate the concept>
 
+
<br><br>
 
the ars shape takes the following values as input:
 
the ars shape takes the following values as input:
 
*The number of points per waterline (the number of vertices on each intermediate polygon)
 
*The number of points per waterline (the number of vertices on each intermediate polygon)
Line 12: Line 12:
 
*X, Y, and Z for an ending point (the last waterline)
 
*X, Y, and Z for an ending point (the last waterline)
  
For example, the command:<p>
+
For example, the command:
 
+
<br><br>
 
in x.1 ars 4 6 0 0 3 1 1 3 1 -1 3 -1 -1 3 -1 1 3 1 1 1 1 -1 1 -1 -1 1 -1 1 1 1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 0 0 -3  
 
in x.1 ars 4 6 0 0 3 1 1 3 1 -1 3 -1 -1 3 -1 1 3 1 1 1 1 -1 1 -1 -1 1 -1 1 1 1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 0 0 -3  
 
+
<br><br>
 
Will produce a square bar with a tapered 1/8 turn twist in the middle. Of course, more waterlines in the twist and more points per waterline would make the twist smoother.
 
Will produce a square bar with a tapered 1/8 turn twist in the middle. Of course, more waterlines in the twist and more points per waterline would make the twist smoother.
 
+
<br><br>
 
<show resulting image here>
 
<show resulting image here>
 
+
<br><br>
 
The parameters to the above ars command can be dissected as:
 
The parameters to the above ars command can be dissected as:
  
4 : number of points per waterline (i.e. intermediate polygons have 4 vertices)
+
4 : number of points per waterline (i.e. intermediate polygons have 4 vertices)<br>
6 : number of waterlines (four intermediate polygons plus the two endpoints)
+
6 : number of waterlines (four intermediate polygons plus the two endpoints)<br>
0 0 3 - the center of the top end of the bar
+
0 0 3 - the center of the top end of the bar<br>
1 1 3 1 -1 3 -1 -1 3 -1 1 3 : a 2x2 square in the xy plane at z offset 3
+
1 1 3 1 -1 3 -1 -1 3 -1 1 3 : a 2x2 square in the xy plane at z offset 3<br>
1 1 1 1 -1 1 -1 -1 1 -1 1 1 : a 2x2 square oriedted the same as the first but at z offset 1
+
1 1 1 1 -1 1 -1 -1 1 -1 1 1 : a 2x2 square oriented the same as the first but at z offset 1<br>
1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 : a 2x2 square at a 45 degree rotation from the first squares at z offset -1
+
1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 : a 2x2 square at a 45 degree rotation from the first squares at z offset -1<br>
1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 : a 2x2 square at a 45 degree rotation from the first squares at z offset -3
+
1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 : a 2x2 square at a 45 degree rotation from the first squares at z offset -3<br>
 
0 0 -3 : the center of the bottom end of the bar
 
0 0 -3 : the center of the bottom end of the bar

Revision as of 12:16, 16 October 2008

Arbitrary Solid shapes are defined using "waterlines". The following figure consists of a start point, some number of intermediate polygons, and an ending point. Each of the intermediate polygons have the same number of vertices and the vertices are numbered 1 thru N. In addition to the intermediate polygons a line will be created that begins at the start point, goes through each polygon at its vertex numbered 1, and terminates at the end point. This is repeated for each polygon vertex 2 thru N. The start point, polygons, and end point are each a "waterline".

<need an image here to illustrate the concept>

the ars shape takes the following values as input:

  • The number of points per waterline (the number of vertices on each intermediate polygon)
  • The number of waterlines (the number of intermediate polygons plus 2)
  • X, Y, and Z for a starting point (the first waterline)
  • for each interior polygon (an intermediate waterline)
    • for each point on the polygon
      • X, Y, and Z for the point on the polygon
  • X, Y, and Z for an ending point (the last waterline)

For example, the command:

in x.1 ars 4 6 0 0 3 1 1 3 1 -1 3 -1 -1 3 -1 1 3 1 1 1 1 -1 1 -1 -1 1 -1 1 1 1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 0 0 -3

Will produce a square bar with a tapered 1/8 turn twist in the middle. Of course, more waterlines in the twist and more points per waterline would make the twist smoother.

<show resulting image here>

The parameters to the above ars command can be dissected as:

4 : number of points per waterline (i.e. intermediate polygons have 4 vertices)
6 : number of waterlines (four intermediate polygons plus the two endpoints)
0 0 3 - the center of the top end of the bar
1 1 3 1 -1 3 -1 -1 3 -1 1 3 : a 2x2 square in the xy plane at z offset 3
1 1 1 1 -1 1 -1 -1 1 -1 1 1 : a 2x2 square oriented the same as the first but at z offset 1
1 0 -1 0 -1 -1 -1 0 -1 0 1 -1 : a 2x2 square at a 45 degree rotation from the first squares at z offset -1
1 0 -3 0 -1 -3 -1 0 -3 0 1 -3 : a 2x2 square at a 45 degree rotation from the first squares at z offset -3
0 0 -3 : the center of the bottom end of the bar