~ Computer-Aided Design page.
~ post date: 2017.2.6, recent update: 2017.2.8

Background

I come into this week with extensive experience with many 2D and 3D softwares including: Autodesk Maya, Rhinoceros, Adobe Illustrator, AutoCAD, Maxwell. I have limited experience with procedural and algorithmic 3D design tools, however. Challenge set.

Contents
  • Antimony
  • Fusion 360
  • Rhinoceros (for 2d things)
  • Jump : Index
  • Project files
  • Download antimony modular containers file
  • Antimony

    Antimony is an open-source, relying on graph composition where nodes represent primatives, 2d shapes, and loads of customizable operations and functions. The graph has an GUI akin to Grasshopper, the infamous Rhinoceros plugin. Antimony's interface includes a 3d viewport which has limited modeling capabilities that automatically log into the graph and a script editor. The script editor enables customization of all the graph nodes and is going to require more time for me to grasp. The advantage here is the algorithmic nature of the modeling. Changes can easily be applied throughout the entire history of the graph and propagate throughout the system. This way a decision made early in the modeling can be adjusted according to new information without breaking the series of subsequent decisions. Design versioning is fast. For me, there are a couple of limitations. One, the scripting interface is a hurdle, at this point, simply due to a lack of education on the subject. Two, Antimony in its basic form works with obstensibly with solid primitives; meaning, custom shapes requires to step back to limitation number one.

    I jumped in, downloaded the free DMG build and found this five minute introductory tutorial which was plenty to get me going on the graph and viewport portions of the modeler.

    Antimony screencast from Matt Keeter on Vimeo.

    There are a few basic interfaces I will list here to save you time.

            Rotate...................Left Mouse
            Pan......................Right Mouse
            Quick Action menu........Shift[Key] A
            

    Here is a screenshot from my own computer after completing the tutorial. #BaBoom.

    Alright now, lets get cracking. I built a basic unit and aggregation possibility for my final project. In reality, its early in development, but I imagine the final project to take on a more shapely appearance. However, that would require greater familiarity with the modeler and this version works well as a base. Further, I assume formal complexity may be adapted to the model over time. Feel free to do whatever you please with this:

    I will break it down. The unit is a rectangle with one side open. I started with two rectangle primitives, one for the outside dimensions and one to set the wall thickness. The "x0" and "y0" values are to set the origin of the center point of the rectangle. I need the thickness and outside rectangle to have the same center point, so the outputs of one are linked to the inputs of the other. Btw, in case of this model, all dimensions are relative. Straight away, it would be preferable to set the wall thickness in an equation: the output of the outside size into a thickness node that then spits the proper inside rectangle size to the wall_thickness node. That way I could simply update the outside size or the thickness value, rather than having to adjust each value in this current setup. In this model it is not a big deal; although, with added graph complexity labor increases exponentially. Next, the two shapes are extruded and the thickness of the bottom wall set by adjusting the "zmin" value of the thickness node. That will move the bottom of the primitive up the z-axis. For the hole in the top, the "zmax" of the thickness node should be at least equal to the outside height, thus the output of the outside height value is linked to the thickness node (a change in the overall height will automatically adjust the thickness so the unit will always be open at the top). In the graph, I was able to set these as simple equations because: math. The final step to get the unit is to difference the thickness from the outside primitive. Booleans are built into the CSG menu. "a" is the primary shape, "b" is the subtracting shape.

    The next step is to aggregate the units. First, to make subsequent calculations simpler, I recentered the unit to the origin of the grid: 0,0,0. Then, rotate the unit on the X-axis some value. Finally, array the unit. The array node is split into values for quantity: i,j,k corresponding to direction: x,y,z. Again, equations would be useful here. "dx" equals outside width multiplied by 2 (offset two columns). "dz" is more complicated. I will explain below. Because the even number columns are offset on the z-axis, the rotated output was split to a recenter node to move an initial unit into position for arraying. The recentered node can connect into the same aggregate input.

    I used another 2D CAD application to find the "dz" value by sketching the system to scale in elevation. In this case, a 2x2 unit rotate 30 degrees copied along a vertical line to an intersection point on the outside wall. Again, this operation should be capable of using an equation based on the outside dimensions and the rotation angle; it is beyond my ability tonight. The found value is copied into the array node and divided in half for the second recenter node.

    Finally, built into Antimony is an STL export node. Plug a shape output into the export shape input, use the defaults and push out an STL file. The second image is the STL opened in FSTL, another free application from Matt Keeter. I do not know why it rotates the output 180 degrees on the Y axis.

    Update: Aside from the geometrical problem of solving for distance of array along the z-axis relative to the unit's rotation along the x-axis, many of the other missing bits of automation I solved. You can add a simple script node and click on the upper right corner to edit it. I was mistakingly adding an equal sign in the output line. Do not do that. Do this:

            output('y',y=w-th).......wrong
            output('y', w-th)........ding!
            

    Looking at this, it appears yet inefficient. Although, it is operational. I believe I could edit the script in the thickness nodes to incorporate the now external formulas... And with the magic timelessness of the internet, success! Simply taking what I learned with the simple scripts one step forward, I could understand the preset scripts in the nodes and add some inputs and make little modifications to the formulas. In other words, customizing generic commands for specific needs. That is the whole point, right? The graph screen, before and after.

    Here is an example of one of the thickness nodes with the previously external scripting nodes incorporated. I added two width inputs, for no other reason than a future option. Those inputs were sourced from the output of my thickness input node. That number shows up several times so it is simplest to set one controlling node. In fact, in the future, that node could have three thickness values for each of the axes. Aside from the added inputs, in the min & max formulas, I adjusted the height and width values for thickness as so:

            xmin, xmax = x0 - (width-wth)/2, x0 + (width-wth)/2
            ymin, ymax = y0 - (height-hth)/2, y0 + (height-hth)/2
            

    Adjusting the overall size along the X and Y axes and the wall thickness is now very easy. Now if I could only solve the geomtry problem for the array Z distance...

    Update 2: As I was lying down for a nap, high school geometry came gushing from the depths of my suppressed memories. I was thinking of the Z-Array distance problem as a constrained CAD artist (find the intersection). When thought of as triangles, the solution is clearly a cosine formula. Reviewing this previous drawing, one angle is always square and one I set. Further, the length of the outside side, or height of the unit is set.

    Now, write the math into a node. There are a few tricks to this. One, any script required in the outputs needs to be imported into the node. In this case, I need a cosine function, so "import math". In previous node screenshots in this post, "import fab" was called out; that was unnecessary. The cosine function requires radians so conversion math was added. Solving the hypotenuse, or yellow or pink line in the previous drawing, required this bit of code:

            output('array_z', zmax/math.cos(a*math.pi/180))
            zmax.....................unit outside height
            a........................rotation angle on X axis
            math.cos.................cosine script
            math.pi..................Π !
            

    To simplify the interface, I made a master inputs node containing all the user-defined variables. Any change in this node propagates through the entire system and updates the model accordingly. And, finally, one screenshot of the final graph and one of the more attractive configurations I found after gleefully swapping numbers around for the last fifteen minutes.

    Download project files

    I will post links to resources I have found helpful here.

    1. Antimony introduction : From Matt Keeter's blog.
    2. Very fast STL viewer : Download link. Also written by Matt Keeter.
    3. Antimony screencast : A brief introductory tutorial by Matt Keeter (building a screwdriver handle).
    4. Antimony : Download link.
    5. Antimony quick user's guide.
    6. Introducing Antimony... : An interview with Matt Keeter.
    7. Angle conversions : Little introduction to converting angles from degrees to radians and the other way too.
    8. Project file : My Antimony project file.

    Fusion 360

    Fusion 360 seems like a powerful cloud based 3D modeler compatible with OSX, Windows and several mobile OSs. The advantage of the cloud based file structure is always having access to your files (assuming you have internet access, if not... ya screwed) and a built-in collaborative platform. Autodesk is hosting built-in cloud based fabrication and rendering tools as well. Many file types can be imported or exported, in fact, Fusion directly connects to McMaster-Carr's database and quickly pulls in any number of parts. The modeling mostly involves interfacing with a visual modeling window and is capable of setting reactionary relationships between objects: formal relationships, operational joints, etc. Fusion also keeps a history which enables time machine adjustments which then propagate forward through the timeline. Nice. This week, I only had time to run through a couple of tutorials. After following along with this free webinar, I have the confidence to use the application in the future, except for complex-curvy geometries. And, I most likely will.

    It is always helpful to immediately understand the visual interface.

    I will post links to resources I have found helpful here.

    1. Fusion360 website : Download a trial, community, tutorials.
    2. Fusion 360 for beginners : An easy to follow webinar covering the basics.

    Rhinoceros (for 2D things)

    Rhinoceros is a NURBS based modeler capable of freeform surfaces of fair complexity. The interface includes menus / buttons, a modeling window and command prompt. While rooting around the menus and buttons can offer new users introduction to the application's tools, I think the easiest and fastest interface is the command prompt: start typing in a command and the prompt will feed back optional tools. Many tools have dialogue boxes which appear when activated and drawing happens via a mouse or xyz coordinate input from a keyboard. Model elements are organized in groups, layers and blocks. The application supports an impressive range of file types (import, export: i,o). Furthermore, Rhinoceros' capability can be extended through python scripts, plugins such as Grasshopper, a GUI for generative design tools, and on PC: RhinoScript, a scripting tool based on Micorsoft's VBScript language. I think there are some significant limitations to Rhinoceros. First, modeling history is linear without the grasshopper plugin. Grasshopper's GUI is similar to the graph interface of Antimony. Second, NURBS modeling can be extraordinarily difficult to achieve beyond a certain level of flexibility. My ultimate preference is to be able to use the best tool for the job, which means I need to know a variety of tools and often Rhinoceros works best. One clear advantage is Rhinoceros' ability to pull and quickly edit 2D information from 3D geometries. I will introduce some of the 2D commands.

    I will highlight some of the elements of the GUI. Along the top are the menus and the on the left the main and secondary button interface. These both do largely the same things; it is a matter of preference. All the buttons can be clicked for a tool, or the left mouse button can be held for a second over a button to pull out a menu of deeper tools. Additionally, right clicking a button will bring up a smaller set of buttons in a separate window. Just above the modeling window, below the menus and to the left bottom are locational snap and directional restriction options. The right side of the modeling window presents the layer organizer on the top half and object-specific properties on the bottom. Along the top of each section are other dialogues that can be used. Just above the modeling window the current view can be changed to orthogonals and perspectives. Right clicking on the view name reveals a menu with view specific options. Default is to have a command prompt just above the buttons, in my case, I changed a setting to force the command prompt to open in a separate window whenever I begin typing. Many of the commands are similar to AutoCAD and many other versions of CAD.

    drawing:
    point
    circle
    line
    rectangle
    polyline
    curve
    measurements:
    length: length of line or curve
    distance: distance between two points
    area: area of a surface
    geometric transformation:
    move
    copy
    rotate
    extend: make a curve longer
    scale1D
    scale2D
    scale
    mirror
    offset: scale and copy
    fillet: round sharp corners
    2d to 3d and back to 2d:
    planarSrf: turn a closed curve into a surface
    loft: make connecting surface between two lines/curves
    extrude
    make2d: create 2d shape of selected surface, according to current view
    unrollSrf: turn a volume into flat components
    dupBorders: produce curve from boundary of a surface
    cutting/expanding:
    explode: separate segements of a curve/surface
    join: make one curve/surface out of many segments
    split: divides a line/curve/surface at a center point/line/intersective-surface/curve
    trim: split + delete
    extend
    rebuild
    curveBooleon
    make many out of one:
    divide: dividing lines/curves into equal parts
    rebuild: either turn cuves into lines or make ugly curves pretty curves
    housekeeping/getting-around:
    group: locks objects together
    ungroup
    show/hide: select an object and temporary show it or hide it
    zoom: opens many options for quickly recentering the camera
    dot: useful for making notes inside the model
    notes: a notepad contained within a rhinoceros file

    ★ my rhinoceros project file and black stars ★

    Upon entering a command, a dialogue will open to guide you through input. In this case, I drew a 2 x 2 rectangle by entering 2 for the length in the first direction, then 2 again for the other. Initially, I used this file to solve a measurement problem I was having in Antimony. After drawing the rectangle, which was representative of the elevation of one module of my test project, I rotated it to my desired angle: 30 degrees. Enter: rotate then 30. With "ortho" lock and the intersect snap, I can enter "copy", click on the bottom corner and drag the rectangle upwards until it snaps with the virtual intersection at the top of the module (for visual assistance). Finally, I used the "distance" command. Units were irrellevant, I only wanted to build an effective Antimony graph and Rhinoceros was an easy tool for quickly getting a 2D measurement.

    To export geometry, first select which pieces you would like to export. Then type in "export". Select the desired file type from the menu near the bottom.

    I will post links to resources I have found helpful here.

    1. Rhinoceros Website : Download links (trial), tutorials, message board, plug-ins.
    2. RhinoScript : Open source community for sharing RhinoScipt, Python and Grasshopper scripts.
    3. Rhinoceros command list : List of commands and descriptions.
    4. Rhinoceros basic tutorials : Everything you need to start.
    5. List of basic Rhinoceros commands : Most of these are posted above.
    6. Project file : My Rhinoceros project file.

    Jump : Index

    J.travis Russett © 2017
    Creative Commons License All the work contained within is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License
    You may remix, tweak, and build upon my work non-commercially, as long as you credit me and license your new creations under the identical terms.