Overview
Speckle provides a rich set of geometry types that work across all platforms. All geometry objects inherit fromBase and implement common interfaces for properties like units, area, and length.
Points
The fundamental building block - a 3D coordinate:Point Collections
Vectors
Represent direction and magnitude:Lines
A line segment between two points:Line Grids
Polylines
Multi-segment curves defined by vertices:Building Polylines from Points
Planes
A plane with origin and axis vectors:Meshes
Triangle and quad meshes for 3D geometry:Creating Meshes
Mesh face format: Each face starts with vertex count, followed by vertex indices.
[3, 0, 1, 2] = triangle with vertices 0, 1, 2. [4, 0, 1, 2, 3] = quad with vertices 0, 1, 2, 3.Mesh with Colors
Mesh Properties
Building Complex Meshes
Other Geometry Types
Circle
Arc
Box
Units
All geometry objects support units:Common Units
"m"- meters"mm"- millimeters"cm"- centimeters"ft"- feet"in"- inches"yd"- yards"km"- kilometers"mi"- miles
Display Values
Complex objects often have adisplayValue - simplified geometry for visualization:
Always provide
displayValue for custom objects - it ensures they’re visible in Speckle viewers
even without native support.Practical Examples
Example 1: Bounding Box
Example 2: Polyline Simplification
Example 3: Mesh from Height Map
Best Practices
Always set units
Always set units
Explicitly set units on all geometry objects:
Use consistent units within collections
Use consistent units within collections
Don’t mix units in the same collection:
Provide displayValue for custom objects
Provide displayValue for custom objects
Always include visualization geometry:
Validate mesh data
Validate mesh data
Check vertex and face counts:
Summary
specklepy provides comprehensive geometry types:- ✅ Points - 3D coordinates with distance calculations
- ✅ Vectors - Direction and magnitude
- ✅ Lines - Segment between two points
- ✅ Polylines - Multi-segment curves
- ✅ Planes - Origin with axis vectors
- ✅ Meshes - Triangle and quad meshes with colors
- ✅ Curves - Circles, arcs, ellipses, spirals
- ✅ Solids - Boxes and parametric shapes
- Inherits from
Base - Supports units
- Can have custom properties
- Works across all Speckle platforms
Next Steps
Objects & Base Class
Understand the Base class that all geometry inherits from
Custom Objects
Create your own geometry types
Working with Data
Traverse and extract data from complex objects