Skip to main content

Overview

The Arc primitive represents a segment of a circle in 3D space. It is defined by a center point, radius, start angle, end angle, and the number of segments used for tessellation. When the angle range equals 2π, the arc forms a complete circle. Use Cases:
  • Creating circular arcs and curves
  • Drawing complete circles
  • Rounded corners and fillets
  • Circular patterns and designs

Constructor

Rust Constructor Parameters

id
String
required
Unique identifier for the arc instance

TypeScript Constructor Parameters

options
IArcOptions
Configuration options for the arc
options.ogid
string
Optional unique identifier (auto-generated if not provided)
options.center
Vector3
required
Center point of the arc
options.radius
number
required
Radius of the arc
options.startAngle
number
required
Starting angle in radians
options.endAngle
number
required
Ending angle in radians
options.segments
number
required
Number of line segments to approximate the arc (higher = smoother)
options.color
number
required
Arc color as a hexadecimal number (e.g., 0x00ff00 for green)
options.fatLines
boolean
default:"false"
Enable thick line rendering using Line2
options.width
number
default:"20"
Line width when fatLines is enabled

Methods

set_config

Updates the arc’s geometric parameters.

generate_geometry

Generates vertices along the arc using the specified number of segments. For closed arcs (full circles), it automatically creates a face.

get_geometry_serialized

Returns serialized vertex buffer data as a JSON string.

get_brep_serialized

Returns the complete BREP representation including vertices, edges, and faces.

getConfig

Returns the current arc configuration.

discardGeometry

Disposes of the current geometry (called automatically before regeneration).

Properties

id
String
Unique identifier for the arc instance
center
Vector3
Center point of the arc (default: origin)
radius
f64
Radius of the arc (default: 1.0)
start_angle
f64
Starting angle in radians (default: 0.0)
end_angle
f64
Ending angle in radians (default: 2π)
segments
u32
Number of segments for tessellation (default: 32)
brep
Brep
Internal BREP representation containing vertices, edges, and optionally a face for closed arcs
color
number
Arc color (TypeScript only, settable)

Code Examples

Creating a Semicircle

Creating a Full Circle

Creating a Quarter Arc

Using Fat Lines for Arcs

Updating Arc Parameters

Live Demo

Arc Demo

Try the Arc primitive in the browser

See Also

Curve

Smooth curves through control points

Line

Straight line segments

Polyline

Connected line segments
Last modified on March 14, 2026