Synopsis
This design contains a collection of rules to orient and position a new coordinate system in a number of ways. The new coordinate system can be positioned and oriented relative to the parent's coordinate system. This is accomplished either using input vectors and points to calculate the new coordinate system or by copying the coordinate system from another part.
Mixins
FrameMixinModifier
Parameters
Name |
Type |
Description |
localFrame |
frame |
This the coordinate system of the part that mixes in FrameMixin. It is calculated in this design's group rules or - if none of them are used - it is set to the referenceFrame value. |
referenceFrame |
frame |
This is the frame object to use as the localFrame if none of the other parameters are being used to determine the new frame. By default, the value of the referenceFrame is this child's parent's localFrame value. By using this default, a new child that does not have its orientation explicitly specified will inherit it from the parent's orientation. |
origin |
point |
Origin point of the new localFrame value. |
xDirection |
vector |
X direction vector of the new localFrame. By default this is the 1,0,0 vector in the referenceFrame of this part. |
yDirection |
vector |
Y direction vector of the new localFrame. By default this is the 0,1,0 vector in the referenceFrame of this part. |
Group Rules
<origin> Positions the localFrame based on the origin point.
<xDirection> Orients the localFrame based on the xDirection vector.
<yDirection> Orients the localFrame based on the yDirection vector.
<xDirection yDirection> Orients the localFrame based on the xDirection and yDirection vectors.
<ReferenceFrame> Positions and orients the localFrame to match referenceFrame.
To add additional positioning and orientation rules for custom designs, note there are canonical parameters for %%position and %%orientation. These work independently, so the origin (position) of the coordinate system can be defined independently of the coordinate system's alignment (orientation).
Example 1
Name: |
frameMixin_Ex01
|
Design: |
acDrawingDocument
|
Name
|
Type
|
Formula
|
scale |
number |
1 |
shaftLength |
number |
scale * 3/7 |
Child Name: |
shaft
|
Child Design: |
:Cylinder
|
Child List? |
Name
|
Type
|
Supplied
|
Quantity |
integer |
3 |
axis |
vector |
nth(Child.index, {unitX, unitY, unitZ}) |
height |
number |
shaftLength |
radius |
number |
Child.height / 17 |
bottomPoint |
point |
origin |
color |
string |
nth(Child.index, {" blue ", " green ", " red "}) |
Child Name: |
arrow
|
Child Design: |
:Cone
|
Child List? |
Name
|
Type
|
Supplied
|
Quantity |
integer |
3 |
height |
number |
scale - shaftLength |
radius |
number |
Child.height / 5 |
color |
string |
ref(nth(Child.index, shaft), " color: ") |
origin |
point |
ref(nth(Child.index, shaft), " topPoint: ") |
ReferenceFrame |
frame |
ref(nth(Child.index, shaft), " localFrame: ") |
Example 2
Name: |
frameMixin_Ex02
|
Design: |
acDrawingDocument
|
Child Name: |
originAxes
|
Child Design: |
:frameMixin_Ex01
|
Child Name: |
anObject
|
Child Design: |
:Text
|
Name
|
Type
|
Supplied
|
Text |
string |
"Obj" |
charHeight |
number |
1.0 |
Child Name: |
newLocalFrame
|
Child Design: |
:frameMixin_Ex01
|
Name
|
Type
|
Supplied
|
scale |
number |
0.5 |
ReferenceFrame |
frame |
anObject.localFrame |
Example 3
Name: |
frameMixin_Ex03
|
Design: |
acDrawingDocument
|
Child Name: |
originAxes
|
Child Design: |
:frameMixin_Ex01
|
Child Name: |
anObject
|
Child Design: |
:Text
|
Name
|
Type
|
Supplied
|
Text |
string |
"Obj" |
charHeight |
number |
1.0 |
origin |
point |
Point(0, 0, 2) |
Child Name: |
newLocalFrame
|
Child Design: |
:frameMixin_Ex01
|
Name
|
Type
|
Supplied
|
scale |
number |
0.5 |
referenceFrame |
frame |
anObject.localFrame |
Example 4
Name: |
frameMixin_Ex04
|
Design: |
acDrawingDocument
|
Child Name: |
originAxes
|
Child Design: |
:frameMixin_Ex01
|
Child Name: |
anObject
|
Child Design: |
:Text
|
Name
|
Type
|
Supplied
|
Text |
string |
"Obj" |
charHeight |
number |
1.0 |
yDirection |
vector |
unitZ |
Child Name: |
newLocalFrame
|
Child Design: |
:frameMixin_Ex01
|
Name
|
Type
|
Supplied
|
scale |
number |
0.5 |
referenceFrame |
frame |
anObject.localFrame |
Example 5
Name: |
frameMixin_Ex05
|
Design: |
acDrawingDocument
|
Child Name: |
originAxes
|
Child Design: |
:frameMixin_Ex01
|
Child Name: |
anObject
|
Child Design: |
:Text
|
Name
|
Type
|
Supplied
|
Text |
string |
"Obj" |
charHeight |
number |
1.0 |
origin |
point |
Point(0, 0, 2) |
xDirection |
vector |
-unitY |
yDirection |
vector |
unitZ |
Child Name: |
newLocalFrame
|
Child Design: |
:frameMixin_Ex01
|
Name
|
Type
|
Supplied
|
scale |
number |
0.5 |
referenceFrame |
frame |
anObject.localFrame |