Skip to content

feat: add chord-height curve tessellation with open-time circleSides - #192

Merged
mlightcad merged 1 commit into
mainfrom
feat/draw-tessellate
Aug 26, 2026
Merged

feat: add chord-height curve tessellation with open-time circleSides#192
mlightcad merged 1 commit into
mainfrom
feat/draw-tessellate

Conversation

@mlightcad

Copy link
Copy Markdown
Owner

Summary

  • Add chord-height tessellate() for arcs, ellipses, splines, polylines, loops, and areas so short curves use fewer vertices than the old fixed getPoints(100) path.
  • Honor an open-time circleSides option on the database (draft 50 by default) instead of AutoCAD VIEWRES, which is commonly stored as 1000 and would inflate GPU memory and HTML export size.
  • Thread the same tessellation options through entity drawing (Polyline, Spline, Leader, 2dPolyline) and document that renderer circularArc / ellipticalArc / area implementations should use acdbDrawTessellateOptions.

Test plan

  • npx jest for AcGeCurveTessellate, AcDbDrawTessellate, AcDbPolyline, AcDbSpline, AcDbLeader
  • Related geometry-engine specs (AcGeCircArc2d/3d, AcGeEllipseArc3d, AcGeSpline3d, AcGePolyline2d, AcGeArea2d, AcGeLoop2d)
  • Open a drawing with many arcs/circles at draft (50), standard (100), and high (1000) and compare smoothness vs memory
  • Confirm a DWG whose VPORT circleSides is 1000 still draws at draft unless circleSides is passed at open time
  • Downstream cad-viewer: Three.js and SVG renderers tessellate via acdbDrawTessellateOptions; example FileUpload curve-quality preset is wired through

Short arcs now use fewer segments than a full circle, and opening a drawing without circleSides defaults to draft quality so VIEWRES 1000 is not applied accidentally.
@mlightcad mlightcad self-assigned this Aug 26, 2026
@mlightcad mlightcad added the enhancement New feature or request label Aug 26, 2026
@mlightcad
mlightcad merged commit f308a36 into main Aug 26, 2026
1 check passed
@mlightcad
mlightcad deleted the feat/draw-tessellate branch August 26, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant