Skip to content

Dynamo Mesh Toolkit

Patrick Tierney edited this page Mar 20, 2015 · 33 revisions

Introduction

The Dynamo Mesh Toolkit is available through the Dynamo package manager. To install, select "Search for a Package" from the Packages menu, and search for MeshToolkit. Click the down arrow in a circle icon on the left hand side of the window to install. After installation, you will have a MeshToolkit node group in the Library pane on the left side of Dynamo.

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.

The Dynamo Mesh Toolkit is part of Autodesk's ongoing mesh research, and as such will continue to grow over the coming years. Expect new methods to appear on the toolkit frequently, and feel free to reach out to the Dynamo team with comments, bugs, and suggestions for new features.

Nodes

Constructors

ImportFile

ImportFile takes the name of a file as input. The file can be of the following types:

  • .obj - Wavefront OBJ file
  • .mix - Meshmixer file

ByGeometry

ByGeometry take as input Dynamo geometry objects, such as Surfaces or Solids. Points and Curves have no mesh representations so are not valid inputs. The number of triangles produced in the conversion is controlled by the two inputs. Tolerance sets an upper bound over the precision of the mesh, meaning the mesh will be at least as close to the base Surface or Solid as specified (sometimes closer). Set this to -1 to let Dynamo choose a sensible tolerance. maxGridLines sets the maximum number of triangles in the U or V direction. This can help you set a loose upper bound on the number of triangles produced.

ByVerticesAndIndices

ByVerticesIndices takes a list of Points, representing the corners of the mesh triangles, and a list of indices, representing how the mesh is stitched together, and create a new mesh. The vertices input should be a flat list of sets of three points. The indices input should be a flat list of integers. Each set of three integer designates a triangle in the mesh. The integers specify the index of the point in the point list. The indexes should be 0-indexed, ie the first point of list has index 0, the second point has index 1, etc.

Query Methods

Vertices, Edges, Triangles

The Vertices, Edges, and Triangles methods return the underlying Points (vertices), Curves (edges), and Surfaces (triangles) of the mesh. The geometry returned from this method is native Dynamo geometry, with all geometry operations supported, such as extrude, trim, thicken, etc.

Other Methods

ExportMeshes

Eports the mesh into a file format. The type of mesh to export is determined by the file name extension; for instance a file name ending in ".stl" will be exported in the STL format. The following formats are supported:

  • .mix - Meshmixer
  • .obj - Wavefront OBJ
  • .stl - STL format
  • .dae - COLLADA
  • .ply - Polygon File Format

This image shows the conversion of an OBJ mesh into an STL:

Intersect

This method intersects the mesh with an input Plane, returning a PolyCurve. This is useful for slicing the mesh for fabrication, for instance on a laser cutter, waterjet cutter, or CNC mill.

MakeWatertight

The MakeWatertight takes a different a different approach than repair or close cracks, which is to generate a new watertight mesh by sampling the original mesh object. This is more suited to mesh objects that have numerous defects or difficult issues such as self-intersections.

This image shows a non-watertight vase, and its watertight equivalent

Repair

The repair method attempts to rectify mesh defects such as holes and non-manifold regions. The goal of the method is to preserve as much of the original mesh as possible but achieve a watertight result.

Note how the repaired mesh below differs from the MakeWatertight mesh above. The MakeWatertight method uses a filling operation, while repair uses a simple capping operation.

CloseCracks

The CloseCracks method removes internal boundaries on a mesh object. You normally shouldn't have to use this method, unless you have an imported mesh with imported boundaries you would like removed.

Clone this wiki locally