Author: RoaringTide (page 15 of 17)

Shape Merging

steampunk-arch

archimatix-2016-09-08_09-30-07_amarchimatix-2016-09-08_09-30-33_am

In this tutorial, we introduce the basics of combining Shapes from the 2D Library to easily create complex forms.After completing this tutorial, you will have learned:

 

  1. Calling up Shapes from the 2D Library
  2. Modifying Shapes with thickness settings.
  3. Combining Shapes with 2D boolean operations
  4. Extruding interlocking Shapes

Shaping Up

  1. Open the NodeGraphEditor by choosing Windows>Archimatix>NodeGraphEditor
  2. On the lefthand sidebar, scroll down until you see ArchShape. Click on this.
  3. Scroll back to the top and click on Circle.
  4. Multiselect the two nodes in the NodeGraph and from the right sidebar menu, click on ShapeMerger.
  5. The ShapeMerger node palate will show the product of the merger with the Arch as the solid and the Circle as the void.

 

Railing at the Model

Know Your Relations Better

stacking

Simple Relation for stacking: the Cylinder is always atop the Box.

archimatix-2016-09-08_09-30-07_am

archimatix-2016-09-08_09-30-33_am

Artful parametric modeling is all about managing relationships. Not the personal kind, but the algorithmic kind.

By defining meaningful relationships among your parameters, you can encode a new and powerful morphological genus – creating a new species DNA, as it were, that can be used to generate hundreds of variations of models.

There are two kinds of parametric relations in Archimatix: 1. inter-nodal connections, and 2. parameter expressions. In this tutorial, we will demonstrate inter-nodal connections.

When you connect parameters from different noes to each other, you are authoring behaviors for your parametric model. When you modify one parameter, all sorts of changes may ripple through the model according to the logic you encoded via Relation connections and mathematical expressions within the Relation. Furthermore, these Relations may be bi-directional, meaning that you can change a parameter anywhere in the graph and changes will ripple out from that parameter.  The default mathematical expression set  when you fist specify a Relation is equivalency, or simply “=”..

Equal Relations

A common case for an equals Relation is when you want one object to always sit atop another, regardless of how tall the bottom object is. In the example to the right, the behavior illustrated is that the blue Cylinder is always atop the red Box.

Try This!

To set up this parametric behavior:

  1. Choose a Cylinder and a Box from the 3D Library (left sidebar in the NodeGraphWindow.
  2. Unfold the Controls of the Box and the
    archimatix-2016-09-07_10-49-17_pm

    A simple “equals” expression.

    Transformations of the Cylinder.

  3. Click on the red connector box on the parameter Extrude in the Box node palette.
  4. Click on the red connector button next to the Trans_Y parameter on the Cylinder node palette.
  5. To test: either click on the Box in the SceneView and then drag the green knob to make the Box taller, or click on the Cylinder and then drag the Y-Axis Position Handle.

You will notice that the relation is bi-directional. Modifying either parameter will alter the related parameter. This is a departure from other parametric modelers which feature uni-directional relations. The benefit of bi-directional is that, when playing with a parametric model in the SceneView, you can click just about anywhere you like and start modifying, rather than searching for the “master” parameter.

However, this freedom is not free: the bi-directionality requires inverse expressions to be input. In the case of our simple example, we did not edit the expression found in th relation, relying on the default equals expression. Let’s take a look at how we might make a slightly more complex relation expression.

Expressing Relations

When would like to have more interesting Relations, you can use the ExpressionEditorWindow that pops up when you click on the green button at the center of the Relation connector cable. In the ExpressionEditorWindow are two text fields allowing you to edit the bi-directional relationship between the two parameters.

Try This!

pistonsimple

Simple piston with sinusoidal relation to shaft rotation.

Lets say that we would like to simulate the movement of a piston relative to the rotation of a crankshaft in a car engine. The piston rises and falls sinusoidally as the shaft turns. The expression is Piston.Trans_Y=Sin(Crankshaft.Rot_X). Lets go ahead and set this up:

  1. Choose a Cylinder from the 3D Library.
  2. Click on the name button at the top of the node palette and rename it “Piston.”
  3. Use your copy and paste short cuts to create a second Cylinder. Name it “Crankshaft.”
  4. Next to the Transformations foldout, click the axis button until it show “X.”
  5. Open the Transformations foldout and choose “Align_X” choose “Center.”
  6. Click on the Crankshaft in the SceneView and reduce the radius a bit.
  7. Connect the Piston.Trans_Y to the Crankshaft.RotX.
  8. Try rotating the Crankshaft – the Piston will continue upward or downward.
  9. Click on the green button in the middle of the red connector cable.
  10. archimatix-2016-09-07_11-47-12_pm

    The Edit Relation window lets you define the bi-directional mathematical expression.

    In the ExpressionEditor, in the field filled in with Crankshaft.Rot_X, change the expression to: Sin(Crankshaft.Rot_X) and then click on the Save button just below.

  11. Test by rotating the Crankshaft again. The Piston will oscillate up an down.
  12. Make the Piston more responsive to the rotation, decrease the stroke and lift it higher above the Crankshaft by editing the expression again to be: 1.5+.5*Sin(2*Crankshaft.Rot_X)

We will save more elaboration on this with the addition of a piston rod, etc. please see the tutorial The Parametric Engine.

 

Best Practice: Relating Translations

relations1

A simple parametric behavior: the red Box and blue Cylinder are always translated to the end of the gold Box.

If you find yourself connecting the Trans_X for one node and the Trans_X of another node to the same source, it is probably better to group the two nodes together with a Grouper and then relate the Grouper’s Trans_X to the source. This is analogous to parenting two GameObjects to an “Empty” GameObject in the Unity hierarchy window. While Archimatix can handle lots of relations, by using relation connections where a grouping would do, you will add more visual complexity to the NodeGraphWindow.

For example, the animation to the right depicts a parametric behavior whereby the red Box and the blue Cylinder are always positioned at the end of the gold Box. There are two ways we could encode this behavior:

archimatix-2016-09-07_10-09-53_pm

Setting translations for each node will lead to many redundant Relations.

Method 1: This method is not preferable, but happens commonly while building up a graph. The Trans_X of the Cylinder has been related to the width parameter of the rectangular plan of the gold Box with an expression of Cylinder.Trans_X=Rectangle.width/2. When the red Box was added to the graph, a similar relation was added between the gold Box and the red Box, as shown in the figure to the right. Now when we drag the Handle for the Rectangle width, the blue Cylinder and the red Box translate accordingly.

The down side of this is that we have two connections and we have to enter the same mathematical expression twice (for the Cylinder and for the red Box). If we want to change that relationship, we have to change it in two places. Also, the graph will quickly get cluttered if such translations are maintained with Relation connections all the time.

 

Grouping Node

Grouping nodes allows fewer Relations.

Method 2: Alternatively, we can feed the Cylinder and Box into a Grouper and then relate the Trans_X of the Grouper to the width of the Rectangle.

The behavior of our parametric model will be exactly the same, but now, if we wish to edit the expression in the relations, we are editing in only one place. Also, the graph will have fewer parametric relations, which tends to make the graph more legible.

 

 

 

BiLevelChamfer

The BiChamferSide is a shape geometry that features independently adjustable top and bottom chamfers and a taper. It is most useful as the default sweep profile for an Extrude Node.

Archimatix 2016-09-05_08-44-20_AM

Node Selection

This page coming soon!

Materials

This page coming soon!

Lightmapping With Archimatix

Introduction

Archimatix (AX) can prepare the models it creates for Unitiy’s Global Illumination (GI) , both realtime and baked. Since AX generates models frequently as parameters are modified, the system makes some assumptions about when in your workflow you are ready to have Unity render the metadata that supports GI.

Voila_Capture 2016-08-21_04-20-15_PM

Arch with Global Illumination

General Workflow

Depending on the complexity of the model, pre-computation for Unity’s GI lighting  can take a significant amount of time (to say the least!). By default, Unity tries to initiate this computation any time it senses that static meshes in the scene have been transformed, added or deleted. Although useful in many cases, this default mode of building the lighting model becomes burdensome when modeling with Archimatix, since, as you drag parameter AX handles in realtime, you are usually regenerating hundreds of meshes per second. Even after you stop dragging and AX generates actual GameObjects, you are likely to keep on modifying and tweaking parameters. While this fluid mesh generation is part of the magic of AX, such rapid changes set the  automatic lightmap build into unnecessary overdrive. There are two ways to avoid this this situation.

The first way to avoid unnecessary computation while modifying the parameters of a model is to simply turn the Auto build mode off. This is done by opening the Unity Lighting Window and unchecking the “Auto” checkbox, as show in the image to the right. With Auto off, you can modify AX meshes to your hearts content with out setting off the lighting computation. When you are ready to see the model rendered with GI, click the manual “Build” button to the right of the “Auto” checkbox.

However, if you have a preference to leave “Auto” on, then you can temporarily  disable Lightmap Static flags for your entire AX model by making sure the Lightmap Flags Enabled checkbox in the Inspector for the model is off. This means that, as AX generates GameObjects with meshes, it does not add the Lightmap Static flag to the the GameObjects and the light mapper will not be aware of the changes to the mesh. With this approach, you can model as much as you like, and then when ready to see it rendered with GI, you can click the Lightmap Flags Enabled checkbox.

Note: The Lightmap Flags Enabled parameter for the model is off by default. This means that, when you first create an AX model, you must check this to on before building the lighting.

Once you have finished a session of modeling and tweaking, and you are ready to take a coffee break, you can click the  “Lightmap Flags Enabled” checkbox in the Inspector for the model. If “Auto” is on, the light mapping will shift into high gear. Otherwise, after checking Lightmap Flags Enabled go to the Lighting window and click on the Build button.

In either mode, when the lighting model is being built, it will only take into consideration the objects that have been generated by nodes that have been designated as Lightmap Static, as we shall see next.

Lightmap Static Flags

If a AX ParametricObject, such as the Extrude_9 in the figure to the right, is set to LightmapStatic (red arrow), then when a GameObject gets generated AX, its static flag will be set to Lightmap Static (so long as the Lightmap Flags Enabled is checked when the model is built), and the Unity GI system will treat it as such when rebuilding. This static flags setting is analogous to the flag options for any GameObject in Unity, with the difference being that the flag is set internally in the AX node and transferred to GameObjects when they are built by AX.

When you set the static flag for a node, all its upstream nodes will be set to the same flags.

Secondary UVs for Baking

If you have selected Baked GI in the Unity Lighting Window, then you will want to have SecondaryUV’s generated for the meshes created by Archimatix. Since generating these extra UVs, which are used by the Unity lighting model to created rendered lightmaps, takes some extra computation, you must recreate the secondary UVs each time you bake the lighting.

The checkbox called Create Secondary UV’s appears only after the Lightmap Flags Enabled checkbox has been checked. When you check it, the Secondary’s will be generated for any meshes generated by nodes that have had their flags set to Lightmap Static..

Even if you check the Create Secondary UV’s, this box will become unchecked after the AX model has finished one of its frequent builds.

 

Parametric Shapes

Parametric shapes are the heart of Archimatix modeling. Much of the form generation in real architecture is defined by shapes that are then extruded, swept and repeated. In this sense, architectural forms are a departure from sculptural forms such as organic bodies, automotive forms or geological formations which are more topological in nature and best model with 3D booleans and sculpting tools found in Maya and ZBrush. Much of architecture, on the other hand, can be described digitally using plan shapes and section shapes. In Archimatix, plans and sections are usually parametric shapes.

A parametric shape is a 2D form that is generated by a certain geometric logic and sized by input parameters. A simple but common example of a parametric shape is a circle, which is defined simply by a single parameter, the radius. The full description of a circle at runtime in Unity is a set of vertices that are in its circumference. Depending on the detail level, there may be dozens of vertices. But for the person using a circle for modeling, the radius parameter is a convenient way to think more abstractly about the shape.

 

More examples of parametric shapes, such as the ArchShape can be found in the Archimatix 2D Library. Many of the parametric shapes that ship with archimatix are listed in the sidebar to the right.

To create your own parametric shapes, you can start with an empty Shape node and code your own logic for the geometry using parameters you define yourself.

 

ArchShape

zz-AX-2DLib-ArchShapeThe ArchShape is a useful parametric shape for making doorways and windows. It is open by default to allow easy use as a plan for a molding sweep using PlanSweep. If you close it, you can use it as a subtraction shape in a ShapeMerger to cut a window opening out of a wall or feed it into a Repeater2D to cut an array of window holes.

 

Parameters

radius

adius or the arc. This parameter also controls the width of the arch.

springHgt

The vertical height of the point from which the arch springs.

segs

The number of segments to complete the 180 degree arc of the arch.

 

Examples

ArchMolding01

ArchMolding01

ArchMolding01

Robot Kyle demonstrates the ArchMolding01, the result of a simple PlanSweep.

zz-AX-3DLib-ArchMolding01

This simple arch is made from two shape nodes and a PlanSweep node. The first shape node is the plan shape, which is a simple ArchShape. The Section shape is a parametric shape described by four parameters.

The form of the arch may be modified by adjusting the handles for the plan and section shapes in the SceneView.

Older posts Newer posts

© 2025

Theme by Anders NorenUp ↑