Documentation Index
Fetch the complete documentation index at: https://docs.opengeometry.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Line primitive represents a straight line segment in 3D space, defined by a start point and an end point. It is the simplest 2D primitive in OpenGeometry and is suitable for creating linear segments, edges, and simple geometric constructions. Use Cases:- Drawing straight line segments
- Creating basic geometric shapes
- Defining edges in technical drawings
- Path offset operations for parallel lines
Constructor
- Rust
- TypeScript
Rust Constructor Parameters
Unique identifier for the line instance
TypeScript Constructor Parameters
Configuration options for the line
Optional unique identifier (auto-generated if not provided)
Starting point of the line
Ending point of the line
Line color as a hexadecimal number (e.g., 0x000000 for black)
Enable thick line rendering using Line2
Line width when fatLines is enabled
Methods
set_config
- Rust
- TypeScript
generate_geometry
- Rust
- TypeScript
get_geometry_serialized
- Rust
- TypeScript
get_offset_serialized
- Rust
- TypeScript
Distance to offset the line (positive or negative)
Angle threshold for beveling acute corners
Enable beveling at acute angles
get_brep_serialized
- Rust
- TypeScript
Properties
Unique identifier for the line instance
Starting point of the line (Rust only)
Ending point of the line (Rust only)
Internal BREP representation containing vertices and edges
Line color (TypeScript only, settable)
Code Examples
Creating a Basic Line
- Rust
- TypeScript
Generating Offset Lines
- Rust
- TypeScript
Using Fat Lines
- TypeScript
Updating Line Configuration
- TypeScript
Live Demo
Line Demo
Try the Line primitive in the browser
See Also
Polyline
Connected line segments
Arc
Circular arc segments
Curve
Smooth curves through control points

