Author: RoaringTide (page 16 of 17)

Compensating for PlanSweep in a Lathe Mesher

Archimatix 2016-08-11_08-05-21_AMPlanSweeper is unique as a spline extruder in that it favors the straight-aways rather than the corners. This makes all the straight segments the same corrections while the bevel sections vary. While this works well for cornices, etc., it is problematic in the Lathe where, as you reduce the number of segments, the section is essentially shifted in toward the center, eventually overlapping the pivot.

To compensate for this, we can shift the section to the right just before sweeping along the circular plan so that it is at the radius defined by the corner vertices. In the figure to the right, dx, the amount of the compensating shift, is calculated.

 

AXSpline.getInsetCornerSpines

Return the AXSplines formed when there is an inset from each vertex. If two corner vertices are closer than some minimum segment length, group them together before adding beginning and end points. A corner vertex is one that is greater than the break angle.

Archimatix 2016-06-29_05-23-30_PM

Circle

As the name suggests, the Circle is a parametric Shape where all the vertices are equidistant from a single point, the center.

 

Parameters

The the Circle has a three control parameters that define its geometry.

radius

The radius of the circle sets the distance in units of each vertex from the center of the Circle.

segs

The number of segs determines the number of facets in the Shape, but also the number of vertices. Any meshes generated by the circle may be optimized or decimated by reducing the segs count.

rectifyvoila_capture-2016-12-05_07-02-07_pm

The rectify parameter comes in hand when dealing with a odd number of segs. If the shape is rectified, then, rather starting with a vertex falling on the X-axis, the Cicle is turned so that one facet is parallel to the X-axis. This comes into play for Shapes with small segment counts such as a pentagon.

Handles

voila_capture-2016-12-05_08-14-20_pm

The only Handle described for the Circle Shape is a Circle Handle, which features two sub-handles:  a Point Handle locked to the X-axis, which controls the radius parameter, and a Tangent Handle that is perpendicular to the X-axis and controls the segs parameter.

Logic

voila_capture-2016-12-05_07-31-36_pmThe logic of the Circle is based on an arcl Turtle command in AX Script. The first lines limit the segs to an integer between 1 and 64 and the radius to a minimum of .01 units. a temporary variable called hang is used to rectify the Circle if the rectify parameter is set to true.

 

 

 

 

 

 

 

 

Cylinder

The Cylinder is an an extruded Circle.

 

Migrating Archimatix Models Across Updates

During he beta process, newer builds sometimes break older scenes. This has to do with how Unity addresses MonoBehaviors when it builds. While that is a given, not to worry, since we can easily recover old scenes. The problem is that now and then a new build will lose a reference to the AXModel script that should be attached to the AXModel GameObject in the scene Hierarchy.

The missing script!

Fig. 1. You can re-select the script that has gone missing.

To migrate an older model into a newer version of Archimatix, please follow these steps

  1. Delete the Assets/Archimatix folder and import the new Archimatix package
  2. Open an old scene.
  3. Select the AXModel in the Unity Hierarchy window.
  4. In the Inspector, the you will see a field with a “missing (Mono Script)”
  5. Click on the selection icon on the right side of that field (Fig. 1.)
  6. Choose the AXModel script from the popup list of scripts.
  7. IMPORTANT: Save the scene as a new version and then REOPEN the new version.
  8. Once you reopen the scene the new version your graph should be there!

At this point, your scene should be back operation!

Although the Archimatix Shape Library ships with a variety of parametric shapes, such as Circle, Square, RoundedRectangle, Cross, IBeam, etc., that can be added and subtracted to each other, it may be worthwhile for you to “code” your own Shapes using Turtle scripting and defining your own SceneView Handles.

There are three main areas of focus to consider when authoring parametric shapes:

  1. Parameters
  2. Handles
  3. Logic

This list generally reflects the order of implementation of your custom Shape. When designing a Shape it is useful to create a drawing that helps you (or the users of your Shape) visualize its geometry and the parameters that control it.  It is also an interesting exercise to begin with parameters and handles since many geometries can use the same controls.

Archimatix 2016-03-26_11-10-26_AMIn the figure to the right, we see an example of a diagram that just shows parameters and handles for a Shape that might be a thought of as a molding profile.

Each handle in the diagram, represented by a red dot, can be defined in the handle editor to adjust certain parameters when dragged. For example, handle B could control both the edge and width parameters while handle A controls only width and handle C controls only the overall height.

These parameters and handles can be added to the node before any scripting is added to actually draw the geometry. In fact, this same setup could be used to control a variety of geometries. Below are some examples.
Archimatix 2016-03-26_11-25-09_AM
Particular Shape geometries are based on logic that uses the parameters as variables. The logic is coded using simple turtle graphics scripting implemented right in the node palette.

Using the above molding example, let’s take a look at how to create parameters and handles and then use them with logic.

Adding Parameters

Parameters serve as  variables in the logic of the Shape. For example, in a rectangle Shape, the main parameters are width and height. These parameters are then used to position the SceneView handles and as variables in the description of the rectangle in the logic section of the node palette.

Since we have these same parameters specified in our molding diagram above, it may be best to start our custom Shape with an instance of the Rectangle from the AX Library (choose the Rectangle Shape from the left-hand sidebar of the NodeGraph EditorWindow).

To modify the Rectangle Shape, we will need to add an new parameter called edge. In the Archimatix NodeGraph Editor Window, the parameters are found under the Geometry foldout in the node palette for the parametric shape. You can add as many parameters as you like to the node by clicking on the “+” button at the bottom of the parameter list. Once the add button is clicked, a new parameter will be added to the node and opened for editing.

Naming a Parameter

When the parameter is opened for editing, the name field will be an editable TextField. When choosing a name, be sure not to leave any spaces. This is important since you will need to reference this name as a variable in the script for the Shape’s logic.

For now, we will only edit the parameter’s name, however, you may notice that, in addition to editing the name, you can choose the data type for the parameter (float, int or bool) and start to define expressions for how other parameters in the node should be adjusted if this parameter is modified.

For our molding example, edit the name of the new parameter to be “edge.”

Creating a New Handle

In the Handles foldout of the node palette, you will find a list of named handles. Each of these generates a SceneView handle and defines the behavior of that handle with respect to how it modifies the node’s parameters.

Before adding our new handle, we need to adjust the current width and height handles to adapt them so they are not centered on the origin. Go ahead and click on the width handle and edit the position expression for X to width instead of width/2. Also, adjust the expression to width=han_x. Don’t worry that the Shape is not following these handles yet. Then click on the height handle and set the Y-position to height instead of height/2 and edit the expression so that it is height=han_y.

To create a handle for the edge parameter, click the “+” button under the Handles foldout and name the new handle “edge.” The default type of handle, “Point,” is fine for this. In the position fields, we want to describe where the handle should appear. In this case, the x-position of the handle should be width and the y-position should be the expression height-edge.

After entering these expressions into the x and y fields for Position, the handle should immediately appear in the SceneView, though it is not draggable yet. To make the handle interactive, we have to tell it how to set its parameters when dragged. To do this, edit the first expression for the handle to “width=han_x”. This says that what ever the x-value for the handle is, this should be the value for the width of our Shape. In the vertical direction, we will use the y-value of the handle, or the han_y. Click the “+” button to add a new expression and set it to “edge=height-han_y”.

Now you should be able to drag your new handle and reset the parameters for edge and width.

Logic

 

Now that we have our parameters (and SceneView handles to modify them), we can use these parameters to “draw” the geometry of our shape.

To draw, we use a sequence of commands that tell the virtual pen tip where to go next from the previous line of script. The mov x y dir  command tells the pen to move to the position x, y and orientate itself in direction dir. If the next line of script is fwd 10, then the turtle will draw a line from the starting x,y position to a point 10 units out in the current direction. For a full list of the AX turtle commands available, please see the API.

For our example, let’s start out with a simple molding that features a chamfer. Here is what the turtle script should look like:

mov width 0 90
fwd height-edge
arcl 90 edge 5
fwd width-edge

 

 

As you can see, after entering this script into the Logic TextArea of the node palette, we are using the parameters, or variables, width, height and edge to draw our Shape. Now, dragging the “edge” handle allows us to generate permutations such as these:

Archimatix 2016-03-27_12-57-33_AM Archimatix 2016-03-27_12-57-28_AM Archimatix 2016-03-27_12-57-24_AM

And now the shape is ready to be used for the section of a PlanSweep:

Archimatix 2016-03-27_01-01-57_AM

But, what if we wanted the molding to have more detail? Perhaps something to like the first section above with the quarter-round in the bevel. Lets recode the geometry a bit, but with the same parameters and handles.

mov width 0 90
fwd height-edge
left edge/3
arcl 90 edge/3 5
right edge/3
fwd width-edge

 

 

In this version, we have added a bit of mathematical expression such as edge/3. The resulting molding looks like this:

Archimatix 2016-03-27_01-09-18_AM

 

For full documentation on the Archimatix Script API, click here.

 

 

 

 

 

Floor Stories

Architecture often involves a lot of repetition. In the vertical direction, the repetition gets awfully exciting, if not downright vertiginous.  Stacking floors into a multi-story structure not only adds breath-taking height, but also adds spaces which are fun to explore  as the structure gets taller, as long as you keep a safe distance from the edge!

In this five minute tutorial we will use the Archimatix Floor Repeater to create a building in Unity.  We follow the inspiration of a famous concept design from the early days of modern architecture, Le Corbusier’s Maison Dom-ino. With its minimal use of basic architectural  elements, floor, column and stair, it provides the perfect demonstration of floor repetition Continue reading

Getting a Handle on PlanSweep

 

 

Voila_Capture 2014-10-02_05-40-49_PM

Let’s take a look at how Handles can help you take control of Archimatix objects in the Unity SceneView. When you grab an object from the Archimatix library, it appears in the scene and is automatically selected, revealing the Handles that have been incorporated into it. By clicking and dragging these handles, you can alter various parameters. For example, with the conical object above made from a PlanSweep Generator, clicking on the centroid of the Section shape lets you change the size of the cone and the angle of its slope.

Voila_Capture 2014-10-02_05-41-16_PM

Advanced – Become a Handles Handler!

If you interested in making your own parametric objects, you can add Handles to customize how your users will interact with them. If you combine two shapes in a PlanSweep Generator, you will automatically have the Handles associated with the individual shapes. But you can go ahead and add your own handles as well. To do this, open the Handles section on any Palette and click the “+” button. Once the new Handle has been created, you can name it and then fill in the X, Y, and Z fields to tell the handle where it should place itself at any given time. In the fields add numbers or expressions using parameter names from the Controls section and mathematical symbols or functions.

For example, if you would like an outrigger handle that is always at twice the radius of an object, then you could fill the X-field in with 2*radius. As you slide the radius slider, on the palette, the handle in the SceneView will always be on the X-axis two radius’ away. Now, to have the handle alter a parameter, you add an expression (below the position fields).

 

 

 

 

 

Getting into Shapes

Shapes are important in Archimatix because they are at the root of mesh generation. Unlike a topological modeler, where vertices and polygons are copied and manipulated directly, Archimatix is a parametric modeler in which meshes are typologically generated from sets of rules and modified by controllers. These rules and controllers can be authored by you or you can combine the dozens parametric shapes that come bundled with Archimatix. These “living” smart shapes can be rigged up with parametric mesh generators to author your own typology of vehicles, weapons, buildings and urban fabric. A shape, while itself parametric, becomes a parametric generator of many varied meshes.

While archimatix provides the ability to edit shapes topologically, for example, clicking on a vertex and moving it, the real power of the modeler comes in when shapes are manipulated by handles that embed logical relationships.

A simple example of a parametric shape that would be hard to make topologically, one vertex at a time,  is a circle. Many things in the world are generated from circles–barn silos, cannon barrels, mot & bailey castles, etc. One need not define each point in the circle, only a center and a point at a given radius away. The rules of a circle quickly generate all the vertices that form the shape. While no one would try to create a circle with a topological editor, the example provides a sense of the power of parametric curves with relatively few control handles.

Archimatix not only provides a host of bundled parametric shapes that reflect common architectural, mechanical and mathematical typologies, , but it supports the authoring of custom parametric curve logic that lets the designer define what handles would be best for that shape.

For example, let’s say that you want to create a certain kind of hut that would be made from an “I” shape with a semicircle extending off the shape somewhere. While each hut in the village is unique in its proportions, all huts share this I-with-a-circle” typology, which itself is a function of the villagers’ culture. If such a shape is not already in the library, based on example already in the library, you can “code” one and decide what parameters should be used to allow others to berate many I-shaped house variations. This shape can then be rigged up with mesh generators to easily generate dozens of unique houses that share a certain art. In this sense, you can make a new “type” of shape that can be instantiated in many permutations that go beyond the basic transformations of translation, rotation and scaling, thereby generating village after village in a certain cultural domain of your world.

Over time, you may build up a library of shapes that are specific to the art direction of your game. These shapes may be used by other artists on the project to make things “in the art” of your shape, while no to instance of the shape need be duplicates.

 

The Venerable Column

Voila_Capture 2014-09-02_09-52-14_PMIn order to think through the nature of parametric relations, I have been working with what will be a foundational library item to ship with the first version of Archimatix: a parametric column. At first glance, a column seems so simple–a circular shaft on a rectangular base, topped with a capital and a rectangular abacus. What could be so difficult about that? Why make it parametric and not simply a modular primitive? As it turns out, the column is an architectural element that we are particularly sensitized to.  And columns are everywhere! Continue reading

Older posts Newer posts

© 2025

Theme by Anders NorenUp ↑