Professional Documents
Culture Documents
by Josh Mason
Place three 3D curves with points in the model Loft the curves to create a BSplineSurface. Place a point on the surface and replicate as
space. This can be done with a short cut by shown in previous examples. Place a panel on
creating a BSplineCurve byPoints then holding the point grid.
Ctrl and clicking in the model space.
Start a component by placing four points in Create two lines by points from opposite Create a point by centroid of set using the
space and creating a polygon by vertices. corners of the polygon. This becomes crucial vertices of the polygon as your input.
in generating the component. Ex: SetToFindCentroidFrom: shape01.Vertices
Ex: StartPoint: shape01.Vertices[0]
EndPoint: shape01.Vertices[2]
INPUTS
Place a direction by cross product using your This was a shortcut to create a graphVariable. If done properly, you’re symbolic model should
two lines and your centroid, then add a point Now change the length from the last point to look like this. This is important will inform your
by direction and length. Input Dist = 5 for the shape01.Area/Dist. The distance of the point component.
length. This creates a graphVariable Dist. will be relative to the size of the polygon.
To create a weave across the surface the
components need to populate above and
below the surface. To achieve this, we will
have to write a script that passes in distance
values that alternate positive and negative.
for (int i = 0; i < polygon01.Count; i++) Every new array within a double has to be
{ initialized if values are not immediately passed
into it.
holder[i] = {};
This equation returns 1 or -1 for every integer.
% is the remainder after the division of two
direction = i%2*-2+1; values (9 % 5 = 4)
for (int j = 0; j < polygon01[i].Count; j++) Put a positive or negative magnitude into each
{ element of the array.
holder[i][j] = direction*magnitude;
Conclusion:
Note that the array now has a value for each
component so it is not as accessible. We could
use a GraphVariable instead of a magnitude
but this would require indirect contact with the
component. Additionally, creating alternative
weave patterns requires another transaction
script.
Create a BSplineCurve byPoints using Creating a copy using the Transpose of
ScriptedComponent.point11. This creates an ScriptedComponent.point11 gives the opposite
array of curves. weave direction.
Alternatively, we can create a component This pops up the scripting window with the GC statement builder
by Function thereby keeping the magnitude following useful buttons on the menu bar. This is very handy for the novice programmer.
accessible. To create a component by function, It sets out the construction of loops and
click here: Tab in/out Bookmarks conditional statements. To use, click on the
(I don’t use them)
relevant heading, input variables and hit
Comment/Uncomment return.
double holder = {}; As before, we need a double array to match the number of panels.
int direction = 1;
Try using the statement builder here and tabbing between the blue
for (int i = 0; i < panels.Count; i++) boxes that pop up.
{
holder[i] = {};
direction = (i % 2) * (-2) + 1;
As before.
for (int j = 0; j < panels[i].Count; j++)
{
holder[i][j] = direction*magnitude;
direction = -direction;
}
}
Here you are declaring that the component you are creating
A_UEL_can temporaryComponentVariable = new A_UEL_can(this); be assigned to the feature calling the function. This adds
temporaryComponentVariable.ByDefault(holder, panels); the components to the parent feature so the double array of
} components actually arrives as the first index of a triple array. If you
mouse-over a point you will see newcomponent[0][1][1].point13.
FunctionArguments
Debugging
{polygon01, 5}
Add a ‘breakpoint;’ at any point in any script and you will get a debugging window where
Although it was not declared the function
you can watch variables and follow your script as it plays.
requires a double array for ‘panels’ and will
throw an error if one is not provided.
Alternatively, before activating a script whether as a feature by function or a script
transaction, go to Debug -> Manage Breakpoints. Here you can add breakpoints to
The magnitude, 5 in this case, can now be
scripts or features that will only execute when you hit Execute All.
changed easily from outside the script and in
later transactions without writing another script.
You can also right click on any feature’s properties and click ‘Watch This Property.’
We can create BSplineCurves on top of
the components as before or create a
BSplineCurve.ByFunction as follows:
Copy the entire script from before to a new Here, the component is created as temporary construction meaning
BSplineCurve.ByFunction. Replace ‘this. it is never put on screen. It is used purely as a scaffold with which
ByDefault(holder, panels); with we create our BSplineCurves.
A_UEL_can temporaryComponentVariable = new A_UEL_can(); As before, we use ‘this’ to refer to the parent feature. Since it is a
temporaryComponentVariable.ByDefault(holder, panels);v BSplineCurve we can use the ByPoints method. Note that although
there is not the typical drop down menu, we can operate on the ‘this’
this.ByPoints(temporaryComponentVariable.point11); placeholder as if it were a BSplineCurve (as illustrated by the ‘Color’
this.Color = 5; command).
As before the curves weave through the Using a variable for the magnitude, the Creating a copy of the previous curve by
polygons we’ve created. Symbolic Model is still considerably simplified function and using the Transpose of the
with the component not visible. polygons and the negative of the magnitude
variable, mag, we arrive at the weave above.
Conclusions