Goal
Create or extract mesh and point geometry from Speckle model data when analysis needs vertices, areas, or lengths — not only BIM properties.When to use this
Most AEC automation usesDataObject.properties for schedules and QA — start with Find objects by property. Read this guide when you need 3D geometry from displayValue or Speckle.Objects types.
Install separately:
dotnet add package Speckle.Objects. Not a dependency of Speckle.Sdk.Recommended approach
- Receive model with
Receive2 - Extract meshes via
Flatten().OfType<Mesh>()orTryGetDisplayValue<Mesh>() - For creating geometry to send, put primitives in
DataObject.displayValue
Prerequisites
Complete Example
Mesh Data Layout
Mesh.vertices and Mesh.faces are flat lists:
vertices: flatx, y, z, x, y, z, ...triplesfaces: each face starts with vertex count (n-gon size), followed by indices —[3, 0, 1, 2, 4, 1, 2, 3, 4]is one triangle then one quad
Units
Geometry types carry aunits string (Units.Meters, Units.Millimeters, etc.). Objects in the same graph can use different units.
Extracting Geometry from Received Data
All meshes in a graph:displayValue:
Material
RenderMaterial (Speckle.Objects.Other) is typically set as a dynamic renderMaterial property on geometry. For shared materials across many objects, use RenderMaterialProxy — see Working with Proxies.
Common Pitfalls
IndexOutOfRangeException reading vertices/faces
IndexOutOfRangeException reading vertices/faces
vertices.Count must be a multiple of 3. Validate list lengths from untrusted sources.Mesh renders with holes in a triangle-only viewer
Mesh renders with holes in a triangle-only viewer
The mesh likely contains n-gons — triangulate first.
Sent geometry doesn't appear in the viewer
Sent geometry doesn't appear in the viewer
Put geometry in a container’s
displayValue — see Display values.Next Steps
Objects and Traversal
displayValue and Base mechanics
Find objects by property
Extract meshes after receive
Operations API
Send and receive geometry graphs