As a Visual Programming environment, Dynamo enables you to craft the way that data is processed. Data is numbers or text, but so is Geometry. As understood by the Computer, Geometry - or sometimes called Computational Geometry - is the data we can use to create beautiful, intricate, or performance-driven models. To do so, we need to understand the ins and outs of the various types of Geometry we can use.
Geometry is the language for design. When a programming language or environment has a geometry kernel at its core, we can unlock the possibilities for designing precise and robust models, automating design routines, and generating design iterations with algorithms.
Understanding the Geometry types and how they are related will allow us to navigate the collection of Geometry Nodes available to us in the Library. The Geometry Nodes are organized alphabetically as opposed to hierarchically - here they are displayed similar to their layout in the Dynamo interface.
Additionally, making models in Dynamo and connecting the preview of what we see in the Background Preview to the flow of data in our graph should become more intuitive over time.
Note the assumed coordinate system rendered by the grid and colored axes
Selected Nodes will render the corresponding geometry (if the Node creates geometry) in the background the highlight color
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
Geometry, traditionally defined, is the study of shape, size, relative position of figures, and the properties of space. This field has a rich history going back thousands of years. With the advent and popularization of the computer, we gained a powerful tool in defining, exploring, and generating geometry. It is now so easy to calculate the result of complex geometric interactions, the fact that we are doing so is almost transparent.
If you're curious to see how diverse and complex geometry can get using the power of your computer, do a quick web search for the Stanford Bunny - a canonical model used to test algorithms.
Understanding geometry in the context of algorithms, computing, and complexity, may sound daunting; however, there are a few key, and relatively simple, principles that we can establish as fundamentals to start building towards more advanced applications:
Geometry is Data - to the computer and Dynamo, a Bunny not all that different from a number.
Geometry relies on Abstraction - fundamentally, geometric elements are described by numbers, relationships, and formulas within a given spatial coordinate system
Geometry has a Hierarchy - points come together to make lines, lines come together to make surfaces, and so on
Geometry simultaneously describes both the Part and the Whole - when we have a curve, it is both the shape as well as all the possible points along it
In practice, these principles mean that we need to be aware of what we are working with (what type of geometry, how was it created, etc.) so that we can fluidly compose, decompose, and recompose different geometries as we develop more complex models.
Let's take a moment to look at the relationship between the Abstract and Hierarchical descriptions of Geometry. Because these two concepts are related, but not always obvious at first, we can quickly arrive at a conceptual roadblock once we start developing deeper workflows or models. For starters, let's use dimensionality as an easy descriptor of the "stuff" we model. The number of dimensions required to describe a shape gives us a window into how Geometry is organized hierarchically.
A Point (defined by coordinates) doesn't have any dimensions to it - it's just numbers describing each coordinate
A Line (defined by two points) now has one dimension - we can "walk" the line either forward (positive direction) or backward (negative direction)
A Plane (defined by two lines) has two dimensions - walking more left or more right is now possible
A Box (defined by two planes) has three dimensions - we can define a position relative to up or down
Dimensionality is a convenient way to start categorizing Geometry but it's not necessarily the best. After all, we don't model with only Points, Lines, Planes, and Boxes - what if I want something curvy? Furthermore, there is a whole other category of Geometric types that are completely abstract ie. they define properties like orientation, volume, or relationships between parts. We can't really grab a hold of a Vector so how do we define it relative to what we see in space? A more detailed categorization of the geometric hierarchy should accommodate the difference between Abstract Types or "Helpers," each of which we can group by what they help do and types that help describe the shape of model elements.
Creating models in Dynamo is not limited to what we can generate with Nodes. Here are some key ways to take your process to the next level with Geometry:
Dynamo allows you to import files - try using a CSV for point clouds or SAT for bringing in surfaces
When working with Revit, we can reference Revit elements to use in Dynamo
The Dynamo Package Manager offers additional functionality for extended geometry types and operations - check out the Mesh Toolkit package
Vector is a representation of magnitude and direction, you can picture it as an arrow accelerating towards a particular direction at a given speed. It is a key component to our models in Dynamo. Note that, because they are in the Abstract category of "Helpers," when we create a Vector, we won't see anything in the Background Preview.
We can use a line as a stand in for a Vector preview.
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
Plane is a two dimensional surface, you can picture it as a flat surface that extends indefinitely. Each Plane has an Origin, X Direction, Y Direction, and a Z (Up) Direction.
Although they are abstract, Planes do have an origin position so we can locate them in space.
In Dynamo, Planes are rendered in the Background Preview.
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
Coordinate system is a system to determine the location of points or other geometric elements. The image below explains how it looks like in Dynamo and what each color represents.
Although they are abstract, Coordinate Systems also have an origin position so we can locate them in space.
In Dynamo, Coordinate Systems are rendered in the Background Preview as a point (origin) and lines defining the axes (X is red, Y is green, and Z is blue following convention).
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
Vectors, Planes, and Coordinate Systems make up the primary group of Abstract Geometry Types. They help us define location, orientation, and the spatial context for other geometry that describe shapes. If I say that I'm in New York City at 42nd Street and Broadway (Coordinate System), standing on the street level (Plane), looking North (Vector), I've just used these "Helpers" to define where I am. The same goes for a phone case product or a skyscraper - we need this context to develop our model.
A vector is a geometric quantity describing Direction and Magnitude. Vectors are abstract; ie. they represent a quantity, not a geometrical element. Vectors can be easily confused with Points because they both are composed of a list of values. There is a key difference though: Points describe a position in a given coordinate system while Vectors describe a relative difference in position which is the same as saying "direction."
If the idea of relative difference is confusing, think of the Vector AB as "I'm standing at Point A, looking toward Point B." The direction, from here (A) to there (B), is our Vector.
Breaking down Vectors further into their parts using the same AB notation:
The Start Point of the Vector is called the Base.
The **End Point **of the Vector is called the Tip or the Sense.
Vector AB is not the same as Vector BA - that would point in the opposite direction.
If you're ever in need of comic relief regarding Vectors (and their abstract definition), watch the classic comedy Airplane and listen for the oft-quoted tongue-in cheek line:
Roger, Roger. What's our vector, Victor?
Planes are two-dimensional abstract "Helpers." More specifically, Planes are conceptually “flat,” extending infinitely in two directions. Usually they are rendered as a smaller rectangle near their origin.
You might be thinking, "Wait! Origin? That sounds like a Coordinate System... like the one I use to model in my CAD software!"
And you're correct! Most modeling software take advantage of construction planes or "levels" to define a local two-dimensional context to draft in. XY, XZ, YZ -or- North, Southeast, Plan might sound more familiar. These are all Planes, defining an infinite "flat" context. Planes don't have depth, but they do help us describe direction as well -
If we are comfortable with Planes, we are a small step away from understanding Coordinate Systems. A Plane has all the same parts as a Coordinate System, provided it is a standard "Euclidean" or "XYZ" Coordinate System.
There are other, however, alternative Coordinate Systems such as Cylindrical or Spherical. As we will see in later sections, Coordinate Systems can also be applied to other Geometry types to define a position on that geometry.
Add alternative coordinate systems - cylindrical, spherical
A Point is defined by nothing more than one or more values called coordinates. How many coordinate values we need to define the Point depends upon the Coordinate System or context in which it resides.
The most common kind of Point in Dynamo exists in our three-dimensional World Coordinate System and has three coordinates [X,Y,Z] (3D Point in Dynamo).
A 2D Point in Dynamo has two coordinates [X,Y].
Parameters for both Curves and Surfaces are continuous and extend beyond the edge of the given geometry. Since the shapes that define the Parameter Space reside in a three-dimensional World Coordinate System, we can always translate a Parametric Coordinate into a "World" Coordinate. The point [0.2, 0.5] on the surface for example is the same as point [1.8, 2.0, 4.1] in world coordinates.
Point in assumed World XYZ Coordinates
Point relative to a given Coordinate System (Cylindrical)
Point as UV Coordinate on a Surface
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
If Geometry is the language of a model, then Points are the alphabet. Points are the foundation upon which all other geometry is created - we need at least two Points to create a Curve, we need at least three Points to make a Polygon or a Mesh Face, and so on. Defining the position, order, and relationship among Points (try a Sine Function) allows us to define higher order geometry like things we recognize as Circles or Curves.
A Circle using the functions
x=r*cos(t)
andy=r*sin(t)
A Sine Curve using the functions
x=(t)
andy=r*sin(t)
Points can exist in a two-dimensional Coordinate System as well. Convention has different letter notation depending upon what kind of space we are working with - we might be using [X,Y] on a Plane or [U,V] if we are on a surface.
A Point in Euclidean Coordinate System: [X,Y,Z]
A Point in a Curve Parameter Coordinate System: [t]
A Point in a Surface Parameter Coordinate System: [U,V]
Curves are the first Geometric Data Type we've covered that have a more familiar set of shape descriptive properties - How curvy or straight? How long or short? And remember that Points are still our building blocks for defining anything from a line to a spline and all the Curve types in between.
Line
Polyline
Arc
Circle
Ellipse
NURBS Curve
Polycurve
Line is made of a set of points, each line has at least 2 points. One of the most common way to create line in Dynamo is using Line.ByStartPointEndPoint
to create a Line in Dynamo.
NURBS is a model used for representing curves and surfaces accurately. A sine curve in Dynamo using two different methods to create NURBS Curves to compare the results.
NurbsCurve.ByControlPoints uses the List of Points as Control Points
NurbsCurve.ByPoints draws a Curve through the List of Points
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
The term Curve is generally a catch-all for all different sort of curved (even if straight) shapes. Capital "C" Curve is the parent categorization for all of those shape types - Lines, Circles, Splines, etc. More technically, a Curve describes every possible Point that can be found by inputting "t" into a collection of functions, which may range from the simple (x = -1.26*t, y = t
) to functions involving calculus. No matter what kind of Curve we are working with, this Parameter called "t" is a property we can evaluate. Furthermore, regardless of the look of the shape, all Curves also have a start point and end point, which coincidentally align with the minimum and maximum t values used to create the Curve. This also helps us understand its directionality.
It's important to note that Dynamo assumes that the domain of "t" values for a Curve is understood to be 0.0 to 1.0.
All Curves also possess a number of properties or characteristics which can be used to describe or analyze them. When the distance between the start and end points is zero, the curve is "closed." Also, every curve has a number of control-points, if all these points are located in the same plane, the curve is "planar." Some properties apply to the curve as a whole, while others only apply to specific points along the curve. For example, planarity is a global property while a tangent vector at a given t value is a local property.
Lines are the simplest form of Curves. They may not look curvy but they are in fact Curves - just without any curvature. There are a few different ways to create Lines, the most intuitive being from Point A to Point B. The shape of the Line AB will be drawn between the points but mathematically it extends infinitely in both directions.
When we connect two Lines together, we have a Polyline. Here we have a straightforward representation of what a Control Point is. Editing any of these point locations will change the shape of the Polyline. If the Polyline is closed, we have a Polygon. If the Polygon's edge lengths are all equal, it is described as regular.
As we add more complexity to the Parametric Functions that define a shape, we can take one step further from a Line to create an Arc, Circle, Ellipse Arc, or Ellipse by describing one or two radii. The differences between the Arc version and the Circle or Ellipse is only whether or not the shape is closed.
NURBS (Non-uniform Rational Basis Splines) are mathematical representations that can accurately model any shape from a simple two dimensional Line, Circle, Arc, or Rectangle to the most complex three-dimensional free-form organic Curve. Because of their flexibility (relatively few control points, yet smooth interpolation based on Degree settings) and precision (bound by a robust math), NURBS models can be used in any process from illustration and animation to manufacturing.
Degree: The Degree of the Curve determines the range of influence the Control Points have on a Curve; where the higher the degree, the larger the range. The Degree is a positive whole number. This number is usually 1, 2, 3 or 5, but can be any positive whole number. NURBS lines and polylines are usually Degree 1 and most free-form Curves are Degree 3 or 5.
Control Points: The Control Points are a list of at least Degree+1 Points. One of the easiest ways to change the shape of a NURBS Curve is to move its Control Points.
Weight: Control Points have an associated number called a Weight. Weights are usually positive numbers. When a Curve’s Control Points all have the same weight (usually 1), the Curve is called non-rational, otherwise the Curve is called rational. Most NURBS curves are non-rational.
Knots: Knots are a list of (Degree+N-1) numbers, where N is the number of Control Points. The Knots are used together with the weights to control the influence of the Control Points on the resulting Curve. One use for Knots is to create kinks at certain points in the curve.
Degree = 1
Degree = 2
Degree = 3
Note that the higher the degree value, the more Control Points are used to interpolate the resulting Curve.
We use Surface in model to represent objects we see in our three dimensional world. While Curves are not always planar ie. they are three dimensional, the space they define is always bound to one dimension. Surfaces give us another dimension and a collection of additional properties we can use within other modeling operations.
Import and evaluate a Surface at a Parameter in Dynamo to see what kind of information we can extract.
Surface.PointAtParameter returns the Point at a given UV Coordinate
Surface.NormalAtParameter returns the Normal Vector at a given UV Coordinate
Surface.GetIsoline returns the Isoparametric Curve at a U or V Coordinate - note the isoDirection input.
Download the example files by clicking on the link below.
A full list of example files can be found in the Appendix.
A Surface is a mathematical shape defined by a function and two parameters, Instead of t
for Curves, we use U
and V
to describe the corresponding parameter space. This means we have more geometrical data to draw from when working with this type of Geometry. For example, Curves have tangent vectors and normal planes (which can rotate or twist along the curve's length), whereas Surfaces have normal vectors and tangent planes that will be consistent in their orientation.
Surface
U Isocurve
V Isocurve
UV Coordinate
Perpendicular Plane
Normal Vector
Surface Domain: A surface domain is defined as the range of (U,V) parameters that evaluate into a three dimensional point on that surface. The domain in each dimension (U or V) is usually described as two numbers (U Min to U Max) and (V Min to V Max).
Although the shape of the Surface by not look "rectangular" and it locally may have a tighter or looser set of isocurves, the "space" defined by its domain is always two dimensional. In Dynamo, Surfaces are always understood to have a domain defined by a minimum of 0.0 and maximum of 1.0 in both U and V directions. Planar or trimmed Surfaces may have different domains.
Isocurve (or Isoparametric Curve): A curve defined by a constant U or V value on the surface and a domain of values for the corresponding other U or V direction.
UV Coordinate: The Point in UV Parameter Space defined by U, V, and sometimes W.
Perpendicular Plane: A Plane that is perpendicular to both U and V Isocurves at a given UV Coordinate.
Normal Vector: A Vector defining the direction of "up" relative to the Perpendicular Plane.
NURBS Surfaces are very similar to NURBS curves. You can think of NURBS Surfaces as a grid of NURBS Curves that go in two directions. The shape of a NURBS Surface is defined by a number of control points and the degree of that surface in the U and V directions. The same algorithms are used to calculate shape, normals, tangents, curvatures and other properties by way of control points, weights and degree.
In the case of NURBS surfaces, there are two directions implied by the geometry, because NURBS surfaces are, regardless of the shape we see, rectangular grids of control points. And even though these directions are often arbitrary relative to the world coordinate system, we will use them frequently to analyze our models or generate other geometry based on the Surface.
Degree (U,V) = (3,3)
Degree (U,V) = (3,1)
Degree (U,V) = (1,2)
Degree (U,V) = (1,1)
Polysurfaces are composed of Surfaces that are joined across an edge. Polysurfaces offer more than two dimensional UV definition in that we can now move through the connected shapes by way of their Topology.
While "Topology" generally describes a concept around how parts are connected and/or related Topology in Dynamo is also a type of Geometry. Specifically it is a parent category for Surfaces, Polysurfaces, and Solids.
Sometimes called patches, joining Surfaces in this manner allows us to make more complex shapes as well as define detail across the seam. Conveniently we can apply a fillet or chamfer operation to the edges of a Polysurface.
If we want to construct more complex models that cannot be created from a single surface or if we want to define an explicit volume, we must now venture into the realm of Solids (and Polysurfaces). Even a simple cube is complex enough to need six surfaces, one per face. Solids give access to two key concepts that Surfaces do not - a more refined topological description (faces, edges, vertices) and Boolean operations.
You can use Boolean operations to modify solids. Let's use a few Boolean operations to create a spiky ball.
Sphere.ByCenterPointRadius: Create the base Solid.
Topology.Faces, Face.SurfaceGeometry: Query the faces of the Solid and convert to surface geometry—in this case, the Sphere has only one Face.
Cone.ByPointsRadii: Construct cones using points on the surface.
Solid.UnionAll: Union the Cones and the Sphere.
Topology.Edges: Query the edges of the new Solid
Solid.Fillet: Fillet the Edges of the spiky ball
Download the example file by clicking on the link below.
A full list of example files can be found in the Appendix.
Boolean operations are complex and can be slow to calculate. You can use the "freeze" functionality to suspend the execution of selected nodes and affected downstream nodes.
1.Use the right-click contextual menu to Freeze the Solid Union operation
2. The selected node and all downstream nodes will preview in a light grey ghosted mode, and affected wires will be displayed as dashed lines. The affected geometry preview will also be ghosted. You can now change values upstream without calculating the boolean union.
3. To unfreeze the nodes, right-click and uncheck Freeze.
4. All affected nodes and associated geometry previews will update and revert to the standard preview mode.
You can read more about freezing nodes in the Nodes and Wires section.
Solids consist of one or more Surfaces that contain volume by way of a closed boundary that defines "in" or "out." Regardless of how many of these Surfaces there are, they must form a "watertight" volume to be considered a Solid. Solids can be created by joining Surfaces or Polysurfaces together or by using operations such as loft, sweep, and revolve. Sphere, Cube, Cone and Cylinder primitives are also Solids. A Cube with at least one face removed counts as a Polysurface, which has some similar properties, but it is not a Solid.
A Plane is made of a single Surface and is not a Solid.
A Sphere is made of one Surface but is a Solid.
A Cone is made of two surfaces joined together to make a Solid.
A Cylinder is made of three surfaces joined together to make a Solid.
A Cube is made of six surfaces joined together to make a Solid.
Solids are made up of three types of elements: Vertices, Edges, and Faces. Faces are the surfaces that make up the Solid. Edges are the Curves that define the connection between adjacent faces, and vertices are the start and end points of those Curves. These elements can be queried using the Topology nodes.
Faces
Edges
Vertices
Solids can be modified by filleting or chamfering their edges to eliminate sharp corners and angles. The chamfer operation creates a ruled surface between two faces, while a fillet blends between faces to maintain tangency.
Solid Cube
Chamfered Cube
Filleted Cube
Solid Boolean operations are methods for combining two or more Solids. A single Boolean operation actually means performing four operations:
Intersect two or more objects.
Split them at the intersections.
Delete unwanted portions of the geometry.
Join everything back together.
This makes Solid Booleans a powerful time-saving process. There are three Solid Boolean operations that distinguish which parts of the geometry are kept.
Union: Remove the overlapping portions of the Solids and join them into a single Solid.
Difference: Subtract one Solid from another. The Solid to be subtracted is referred to as a tool. Note that you could switch which Solid is the tool to keep the inverse volume.
Intersection: Keep only the intersecting volume of the two Solids.
In addition to these three operations, Dynamo has Solid.DifferenceAll and Solid.UnionAll nodes for performing difference and union operations with multiple Solids.
UnionAll: Union operation with sphere and outward-facing cones
DifferenceAll: Difference operation with sphere and inward-facing cones
In the field of computational modeling, Meshes are one of the most pervasive forms of representing 3D geometry. Mesh geometry is generally made of a collection of quadrilaterals or triangles, it can be a light-weight and flexible alternative to working with NURBS, and Meshes are used in everything from rendering and visualizations to digital fabrication and 3D printing.
Dynamo defines Meshes using a Face-Vertex data structure. At its most basic level, this structure is simply a collection of points which are grouped into polygons. The points of a Mesh are called vertices, while the surface-like polygons are called faces.
To create a Mesh we need a list of vertices and a system of grouping those vertices into faces called an index group.
List of vertices
List of index groups to define faces
Dynamo's mesh capabilities can be extended by installing the Mesh Toolkit package. The Dynamo Mesh Toolkit provides tools to import Meshes from external file formats, create a Mesh from Dynamo geometry objects, and manually build Meshes by their vertices and indices.
The library also provides tools to modify Meshes, repair Meshes, or extract horizontal slices for use in fabrication.
Visit Mesh Toolkit case studies for example on using this package.
A Mesh is a collection of quadrilaterals and triangles that represents a surface or solid geometry. Like Solids, the structure of a Mesh object includes vertices, edges, and faces. There are additional properties that make Meshes unique as well, such as normals.
Mesh vertices
Mesh edges *Edges with only one adjoining face are called "Naked." All other edges are "Clothed"
Mesh faces
The vertices of a Mesh are simply a list of points. The index of the vertices is very important when constructing a Mesh, or getting information about the structure of a Mesh. For each vertex, there is also a corresponding vertex normal (vector) which describes the average direction of the attached faces and helps us understand the "in" and "out" orientation of the Mesh.
Vertices
Vertex Normals
A face is an ordered list of three or four vertices. The “surface” representation of a Mesh face is therefore implied according to the position of the vertices being indexed. We already have the list of vertices that make up the Mesh, so instead of providing individual points to define a face, we simply use the index of the vertices. This also allows us to use the same vertex in more than one face.
A quad face made with indices 0, 1, 2, and 3
A triangle face made with indices 1, 4, and 2 Note that the index groups can be shifted in their order - as long as the sequence is ordered in a counter-clockwise manner, the face will be defined correctly
How is Mesh geometry different from NURBS geometry? When might you want to use one instead of the other?
In a previous chapter, we saw that NURBS surfaces are defined by a series of NURBS curves going in two directions. These directions are labeled U
and V
, and allow a NURBs surface to be parameterized according to a two-dimensional surface domain. The curves themselves are stored as equations in the computer, allowing the resulting surfaces to be calculated to an arbitrarily small degree of precision. It can be difficult, however, to combine multiple NURBS surfaces together. Joining two NURBS surfaces will result in a polysurface, where different sections of the geometry will have different UV parameters and curve definitions.
Surface
Isoparametric (Isoparm) Curve
Surface Control Point
Surface Control Polygon
Isoparametric Point
Surface Frame
Mesh
Naked Edge
Mesh Network
Mesh Edges
Vertex Normal
Mesh Face / Mesh Face Normal
Meshes, on the other hand, are comprised of a discrete number of exactly defined vertices and faces. The network of vertices generally cannot be defined by simple UV
coordinates, and because the faces are discrete the amount of precision is built into the Mesh and can only be changed by refining the Mesh and adding more faces. The lack of mathematical descriptions allows Meshes to more flexibly handle complex geometry within a single Mesh.
Another important difference is the extent to which a local change in Mesh or NURBS geometry affects the entire form. Moving one vertex of a Mesh only affects the faces that are adjacent to that vertex. In NURBS surfaces, the extent of the influence is more complicated and depends on the degree of the surface as well as the weights and knots of the control points. In general, however, moving a single control point in a NURBS surface creates a smoother, more extensive change in geometry.
NURBS Surface - moving a control point has influence that extends across the shape
Mesh geometry - moving a vertex has influence only on adjacent elements
One analogy that can be helpful is to compare a vector image (composed of lines and curves) with a raster image (composed of individual pixels). If you zoom into a vector image, the curves remain crisp and clear, while zooming into a raster image results in seeing individual pixels become larger. In this analogy, NURBS surfaces can be compared to a vector image because there is a smooth mathematical relationship, while a Mesh behaves similarly to a raster image with a set resolution.