Difference between revisions of "BRL-CAD Primitives"

From BRL-CAD
m
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
 
[[category:MGED| Primitives]]
 
[[category:MGED| Primitives]]
==arb8==
 
  
 +
==Arbs==
 +
===arb8===
 
Arbitrary straight-edged shape with 8 vertices.  
 
Arbitrary straight-edged shape with 8 vertices.  
  
Arguments: 8 Vertices in the following order: 1234 vertices for the front face, starting at bottom left, counterclockwise; then 5678 vertices for the rear face, starting at bottom left, counterclockwise.
+
;Handled by: make in form create
 +
;Arguments: 8 Vertices in the following order: 1234 vertices for the front face, starting at bottom left, counterclockwise; then 5678 vertices for the rear face, starting at bottom left, counterclockwise.
 +
;Example:
 +
in unitcube.s arb8  0 0 0  1 0 0  1 0 1  0 0 1  0 1 0  1 1 0  1 1 1  0 1 1
 +
creates the unit cube (first vertex at the origin, extends for 1 unit in x, y and z direction).
 +
 
 +
=== arb7 ===
 +
Special case of arb8, except with point 8 merged into point 5, making the left face triangular
 +
;Handled by: make in form(arb8) create
 +
=== arb6 ===
 +
Arbitrary straight-edged shape with 6 vertices, special case of arb8.
 +
;Handled by: make in form create
 +
;Arguments: 6 Vertices in the following order: 1234 vertices for the front face, starting at bottom left, counterclockwise; then back edge is 5 on bottom, 6 on top.  Top and bottom faces are triangles.
 +
;Example:
 +
 
 +
in arb6.s arb6 1 -1 -1  1 1 -1  1 1 1  1 -1 1  -1 0 -1  -1 0 1
 +
 
 +
=== arb5 ===
 +
special case of arb8.
 +
;Handled by: make in form(arb8) create
 +
=== arb4 ===
 +
special case of arb8.
 +
;Handled by: make in form(arb8) create
 +
=== arbn ===
 +
(make, in)
 +
Arbitrary solid bounded by N planes
 +
;Handled by: make in create
 +
;Arguments:
 +
;; Number of planes
 +
;; xyz direction vector and normal for each plane
 +
 
 +
;Example:
 +
in arbn.s arbn 8  1 0 1 1  -1 0 0 1  0 1 0 1  0 -1 0 1  0 0 1 1  0 0 -1 1  0.5 0.5 0.5 1  -0.5 -0.5 -0.5 1
 +
 
 +
===box===
 +
Special case of arb8
 +
;Handled by: make in form(arb8) create
 +
Arguments:
 +
;V : vertex of first corner
 +
;direction vectors for height, width, and depth
 +
===rpp===
 +
Special case of arb8
 +
;Handled by: make in form(arb8) create
 +
;Arguments: xmin xmax ymin ymax zmin zmax
 +
 
 +
==Ellipsoids==
 +
=== ell ===
 +
Ellipsoid
 +
;Handled by: make in form create
 +
;Arguments:
 +
;;V : vertex point, at the center
 +
;;vectors A B C describing the radii of the ellipses; A points front, B points right, C points up.
 +
 
 +
Example:
 +
in ell.s ell 0 0 0  0 -1 0  1 0 0  0 0 1
 +
=== sph ===
 +
Sphere, special case of the ellipsoid, with vectors A B and C all the same magnitude (radius).
 +
 
 +
Arguments:
 +
;V : vertex point, at the center
 +
;radius
 +
===ehy===
 +
(make in form)
 +
Elliptical hyperboloid
 +
===ell1===
 +
Special case of ellipsoid
 +
===epa===
 +
Elliptical paraboloid
 +
=== ellg ===
 +
 
 +
==grip ==
 +
Grip (not a solid object?)
  
Example:  
+
Arguments:
 +
;V : vertex point of center
 +
;N : normal vector
 +
;L : magnitude
  
in unitcube.s arb8  0 0 0  1 0 0  1 0 1  0 0 1  0 1 0  1 1 0  1 1 1  0 1 1
 
  
creates the unit cube (first vertex at the origin, extends for 1 unit in x, y and z direction).
+
== tor ==
 +
== tgc ==
 +
== tec ==
 +
== rec ==
 +
== trc ==
 +
== rcc ==
 +
== half ==
 +
== rpc ==
 +
== rhc ==
 +
== epa ==
 +
== ehy ==
 +
== eto ==
 +
== part ==
 +
== nmg ==
 +
== pipe ==
 +
 
  
 
==ars==
 
==ars==

Revision as of 04:41, 31 December 2009

Arbs

arb8

Arbitrary straight-edged shape with 8 vertices.

Handled by
make in form create
Arguments
8 Vertices in the following order: 1234 vertices for the front face, starting at bottom left, counterclockwise; then 5678 vertices for the rear face, starting at bottom left, counterclockwise.
Example
in unitcube.s arb8  0 0 0  1 0 0  1 0 1  0 0 1  0 1 0  1 1 0  1 1 1  0 1 1

creates the unit cube (first vertex at the origin, extends for 1 unit in x, y and z direction).

arb7

Special case of arb8, except with point 8 merged into point 5, making the left face triangular

Handled by
make in form(arb8) create

arb6

Arbitrary straight-edged shape with 6 vertices, special case of arb8.

Handled by
make in form create
Arguments
6 Vertices in the following order: 1234 vertices for the front face, starting at bottom left, counterclockwise; then back edge is 5 on bottom, 6 on top. Top and bottom faces are triangles.
Example
in arb6.s arb6 1 -1 -1   1 1 -1   1 1 1  1 -1 1  -1 0 -1  -1 0 1

arb5

special case of arb8.

Handled by
make in form(arb8) create

arb4

special case of arb8.

Handled by
make in form(arb8) create

arbn

(make, in) Arbitrary solid bounded by N planes

Handled by
make in create
Arguments
Number of planes
xyz direction vector and normal for each plane
Example

in arbn.s arbn 8 1 0 1 1 -1 0 0 1 0 1 0 1 0 -1 0 1 0 0 1 1 0 0 -1 1 0.5 0.5 0.5 1 -0.5 -0.5 -0.5 1

box

Special case of arb8

Handled by
make in form(arb8) create

Arguments:

vertex of first corner
direction vectors for height, width, and depth

rpp

Special case of arb8

Handled by
make in form(arb8) create
Arguments
xmin xmax ymin ymax zmin zmax

Ellipsoids

ell

Ellipsoid

Handled by
make in form create
Arguments
vertex point, at the center
vectors A B C describing the radii of the ellipses; A points front, B points right, C points up.

Example:

in ell.s ell 0 0 0  0 -1 0  1 0 0  0 0 1

sph

Sphere, special case of the ellipsoid, with vectors A B and C all the same magnitude (radius).

Arguments:

vertex point, at the center
radius

ehy

(make in form) Elliptical hyperboloid

ell1

Special case of ellipsoid

epa

Elliptical paraboloid

ellg

grip

Grip (not a solid object?)

Arguments:

vertex point of center
normal vector
magnitude


tor

tgc

tec

rec

trc

rcc

half

rpc

rhc

epa

ehy

eto

part

nmg

pipe

ars

Solids of type 'ars' (Arbitrary Faceted Solids) 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.

Example ARS



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