Overview
The Curve primitive represents a curve in 3D space defined by a series of control points. Currently, the curve is represented as a polyline through these control points. It is an open path (non-closed) and is useful for creating smooth or complex curved paths. Use Cases:- Creating curved paths and contours
- Spline-like representations
- Profile curves for sweep operations
- Offset operations for parallel curves
- Complex path definitions
Constructor
- Rust
- TypeScript
Rust Constructor Parameters
Unique identifier for the curve instance
TypeScript Constructor Parameters
Configuration options for the curve
Optional unique identifier (auto-generated if not provided)
Array of control points defining the curve path
Curve color as a hexadecimal number (e.g., 0x00aa55)
Methods
set_config
- Rust
- TypeScript
generate_geometry
- Rust
- TypeScript
get_geometry_serialized
- Rust
- TypeScript
get_offset_serialized
- Rust
- TypeScript
Distance to offset the curve (positive or negative)
Angle threshold for beveling acute corners
Enable beveling at acute angles
get_brep_serialized
- Rust
- TypeScript
dispose
- Rust
Properties
Unique identifier for the curve instance
Array of control points defining the curve
Internal BREP representation containing vertices and edges
Curve color (TypeScript only, settable)
Code Examples
Creating a Simple Curve
- Rust
- TypeScript
Creating a Wave Pattern
- TypeScript
Generating Offset Curves
- Rust
- TypeScript
Creating Multiple Parallel Curves
- TypeScript
Updating Curve Control Points
- TypeScript
Bezier-like Curve Approximation
- TypeScript
Live Demo
Curve Demo
Try the Curve primitive in the browser
See Also
Arc
Circular arc segments
Line
Straight line segments
Polyline
Connected line segments

