@mlightcad/data-model 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-model.cjs +5 -0
- package/dist/data-model.js +25523 -0
- package/dist/dxf-parser-worker.js +1715 -0
- package/lib/base/AcDbHostApplicationServices.d.ts +96 -0
- package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -0
- package/lib/base/AcDbHostApplicationServices.js +118 -0
- package/lib/base/AcDbHostApplicationServices.js.map +1 -0
- package/lib/base/AcDbObject.d.ts +205 -0
- package/lib/base/AcDbObject.d.ts.map +1 -0
- package/lib/base/AcDbObject.js +236 -0
- package/lib/base/AcDbObject.js.map +1 -0
- package/lib/base/index.d.ts +3 -0
- package/lib/base/index.d.ts.map +1 -0
- package/lib/base/index.js +3 -0
- package/lib/base/index.js.map +1 -0
- package/lib/converter/AcDbBatchProcessing.d.ts +146 -0
- package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -0
- package/lib/converter/AcDbBatchProcessing.js +272 -0
- package/lib/converter/AcDbBatchProcessing.js.map +1 -0
- package/lib/converter/AcDbDxfConverter.d.ts +272 -0
- package/lib/converter/AcDbDxfConverter.d.ts.map +1 -0
- package/lib/converter/AcDbDxfConverter.js +874 -0
- package/lib/converter/AcDbDxfConverter.js.map +1 -0
- package/lib/converter/AcDbDxfParser.d.ts +23 -0
- package/lib/converter/AcDbDxfParser.d.ts.map +1 -0
- package/lib/converter/AcDbDxfParser.js +85 -0
- package/lib/converter/AcDbDxfParser.js.map +1 -0
- package/lib/converter/AcDbEntitiyConverter.d.ts +159 -0
- package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -0
- package/lib/converter/AcDbEntitiyConverter.js +659 -0
- package/lib/converter/AcDbEntitiyConverter.js.map +1 -0
- package/lib/converter/AcDbObjectConverter.d.ts +61 -0
- package/lib/converter/AcDbObjectConverter.d.ts.map +1 -0
- package/lib/converter/AcDbObjectConverter.js +91 -0
- package/lib/converter/AcDbObjectConverter.js.map +1 -0
- package/lib/converter/AcDbRegenerator.d.ts +101 -0
- package/lib/converter/AcDbRegenerator.d.ts.map +1 -0
- package/lib/converter/AcDbRegenerator.js +334 -0
- package/lib/converter/AcDbRegenerator.js.map +1 -0
- package/lib/converter/index.d.ts +5 -0
- package/lib/converter/index.d.ts.map +1 -0
- package/lib/converter/index.js +5 -0
- package/lib/converter/index.js.map +1 -0
- package/lib/converter/worker/AcDbBaseWorker.d.ts +36 -0
- package/lib/converter/worker/AcDbBaseWorker.d.ts.map +1 -0
- package/lib/converter/worker/AcDbBaseWorker.js +93 -0
- package/lib/converter/worker/AcDbBaseWorker.js.map +1 -0
- package/lib/converter/worker/AcDbDxfParserWorker.d.ts +11 -0
- package/lib/converter/worker/AcDbDxfParserWorker.d.ts.map +1 -0
- package/lib/converter/worker/AcDbDxfParserWorker.js +75 -0
- package/lib/converter/worker/AcDbDxfParserWorker.js.map +1 -0
- package/lib/converter/worker/AcDbWorkerManager.d.ts +107 -0
- package/lib/converter/worker/AcDbWorkerManager.d.ts.map +1 -0
- package/lib/converter/worker/AcDbWorkerManager.js +360 -0
- package/lib/converter/worker/AcDbWorkerManager.js.map +1 -0
- package/lib/converter/worker/index.d.ts +3 -0
- package/lib/converter/worker/index.d.ts.map +1 -0
- package/lib/converter/worker/index.js +3 -0
- package/lib/converter/worker/index.js.map +1 -0
- package/lib/database/AcDbBlockTable.d.ts +56 -0
- package/lib/database/AcDbBlockTable.d.ts.map +1 -0
- package/lib/database/AcDbBlockTable.js +98 -0
- package/lib/database/AcDbBlockTable.js.map +1 -0
- package/lib/database/AcDbBlockTableRecord.d.ts +185 -0
- package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbBlockTableRecord.js +261 -0
- package/lib/database/AcDbBlockTableRecord.js.map +1 -0
- package/lib/database/AcDbDatabase.d.ts +563 -0
- package/lib/database/AcDbDatabase.d.ts.map +1 -0
- package/lib/database/AcDbDatabase.js +842 -0
- package/lib/database/AcDbDatabase.js.map +1 -0
- package/lib/database/AcDbDatabaseConverter.d.ts +292 -0
- package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -0
- package/lib/database/AcDbDatabaseConverter.js +448 -0
- package/lib/database/AcDbDatabaseConverter.js.map +1 -0
- package/lib/database/AcDbDatabaseConverterManager.d.ts +141 -0
- package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -0
- package/lib/database/AcDbDatabaseConverterManager.js +173 -0
- package/lib/database/AcDbDatabaseConverterManager.js.map +1 -0
- package/lib/database/AcDbDimStyleTable.d.ts +31 -0
- package/lib/database/AcDbDimStyleTable.d.ts.map +1 -0
- package/lib/database/AcDbDimStyleTable.js +49 -0
- package/lib/database/AcDbDimStyleTable.js.map +1 -0
- package/lib/database/AcDbDimStyleTableRecord.d.ts +797 -0
- package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbDimStyleTableRecord.js +1294 -0
- package/lib/database/AcDbDimStyleTableRecord.js.map +1 -0
- package/lib/database/AcDbDwgVersion.d.ts +32 -0
- package/lib/database/AcDbDwgVersion.d.ts.map +1 -0
- package/lib/database/AcDbDwgVersion.js +126 -0
- package/lib/database/AcDbDwgVersion.js.map +1 -0
- package/lib/database/AcDbLayerTable.d.ts +51 -0
- package/lib/database/AcDbLayerTable.d.ts.map +1 -0
- package/lib/database/AcDbLayerTable.js +92 -0
- package/lib/database/AcDbLayerTable.js.map +1 -0
- package/lib/database/AcDbLayerTableRecord.d.ts +278 -0
- package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbLayerTableRecord.js +397 -0
- package/lib/database/AcDbLayerTableRecord.js.map +1 -0
- package/lib/database/AcDbLinetypeTable.d.ts +30 -0
- package/lib/database/AcDbLinetypeTable.d.ts.map +1 -0
- package/lib/database/AcDbLinetypeTable.js +48 -0
- package/lib/database/AcDbLinetypeTable.js.map +1 -0
- package/lib/database/AcDbLinetypeTableRecord.d.ts +79 -0
- package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbLinetypeTableRecord.js +129 -0
- package/lib/database/AcDbLinetypeTableRecord.js.map +1 -0
- package/lib/database/AcDbSymbolTable.d.ts +199 -0
- package/lib/database/AcDbSymbolTable.d.ts.map +1 -0
- package/lib/database/AcDbSymbolTable.js +264 -0
- package/lib/database/AcDbSymbolTable.js.map +1 -0
- package/lib/database/AcDbSymbolTableRecord.d.ts +61 -0
- package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbSymbolTableRecord.js +82 -0
- package/lib/database/AcDbSymbolTableRecord.js.map +1 -0
- package/lib/database/AcDbTextStyleTable.d.ts +48 -0
- package/lib/database/AcDbTextStyleTable.d.ts.map +1 -0
- package/lib/database/AcDbTextStyleTable.js +112 -0
- package/lib/database/AcDbTextStyleTable.js.map +1 -0
- package/lib/database/AcDbTextStyleTableRecord.d.ts +179 -0
- package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbTextStyleTableRecord.js +276 -0
- package/lib/database/AcDbTextStyleTableRecord.js.map +1 -0
- package/lib/database/AcDbViewportTable.d.ts +31 -0
- package/lib/database/AcDbViewportTable.d.ts.map +1 -0
- package/lib/database/AcDbViewportTable.js +49 -0
- package/lib/database/AcDbViewportTable.js.map +1 -0
- package/lib/database/AcDbViewportTableRecord.d.ts +154 -0
- package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbViewportTableRecord.js +318 -0
- package/lib/database/AcDbViewportTableRecord.js.map +1 -0
- package/lib/database/index.d.ts +19 -0
- package/lib/database/index.d.ts.map +1 -0
- package/lib/database/index.js +19 -0
- package/lib/database/index.js.map +1 -0
- package/lib/entity/AcDbArc.d.ts +254 -0
- package/lib/entity/AcDbArc.d.ts.map +1 -0
- package/lib/entity/AcDbArc.js +340 -0
- package/lib/entity/AcDbArc.js.map +1 -0
- package/lib/entity/AcDbBlockReference.d.ts +190 -0
- package/lib/entity/AcDbBlockReference.d.ts.map +1 -0
- package/lib/entity/AcDbBlockReference.js +302 -0
- package/lib/entity/AcDbBlockReference.js.map +1 -0
- package/lib/entity/AcDbCircle.d.ts +186 -0
- package/lib/entity/AcDbCircle.d.ts.map +1 -0
- package/lib/entity/AcDbCircle.js +249 -0
- package/lib/entity/AcDbCircle.js.map +1 -0
- package/lib/entity/AcDbCurve.d.ts +42 -0
- package/lib/entity/AcDbCurve.d.ts.map +1 -0
- package/lib/entity/AcDbCurve.js +44 -0
- package/lib/entity/AcDbCurve.js.map +1 -0
- package/lib/entity/AcDbEllipse.d.ts +207 -0
- package/lib/entity/AcDbEllipse.d.ts.map +1 -0
- package/lib/entity/AcDbEllipse.js +272 -0
- package/lib/entity/AcDbEllipse.js.map +1 -0
- package/lib/entity/AcDbEntity.d.ts +385 -0
- package/lib/entity/AcDbEntity.d.ts.map +1 -0
- package/lib/entity/AcDbEntity.js +561 -0
- package/lib/entity/AcDbEntity.js.map +1 -0
- package/lib/entity/AcDbFace.d.ts +151 -0
- package/lib/entity/AcDbFace.d.ts.map +1 -0
- package/lib/entity/AcDbFace.js +224 -0
- package/lib/entity/AcDbFace.js.map +1 -0
- package/lib/entity/AcDbHatch.d.ts +174 -0
- package/lib/entity/AcDbHatch.d.ts.map +1 -0
- package/lib/entity/AcDbHatch.js +250 -0
- package/lib/entity/AcDbHatch.js.map +1 -0
- package/lib/entity/AcDbLeader.d.ts +243 -0
- package/lib/entity/AcDbLeader.d.ts.map +1 -0
- package/lib/entity/AcDbLeader.js +358 -0
- package/lib/entity/AcDbLeader.js.map +1 -0
- package/lib/entity/AcDbLine.d.ts +198 -0
- package/lib/entity/AcDbLine.d.ts.map +1 -0
- package/lib/entity/AcDbLine.js +300 -0
- package/lib/entity/AcDbLine.js.map +1 -0
- package/lib/entity/AcDbMText.d.ts +248 -0
- package/lib/entity/AcDbMText.d.ts.map +1 -0
- package/lib/entity/AcDbMText.js +414 -0
- package/lib/entity/AcDbMText.js.map +1 -0
- package/lib/entity/AcDbPoint.d.ts +113 -0
- package/lib/entity/AcDbPoint.d.ts.map +1 -0
- package/lib/entity/AcDbPoint.js +155 -0
- package/lib/entity/AcDbPoint.js.map +1 -0
- package/lib/entity/AcDbPolyline.d.ts +221 -0
- package/lib/entity/AcDbPolyline.d.ts.map +1 -0
- package/lib/entity/AcDbPolyline.js +301 -0
- package/lib/entity/AcDbPolyline.js.map +1 -0
- package/lib/entity/AcDbRasterImage.d.ts +216 -0
- package/lib/entity/AcDbRasterImage.d.ts.map +1 -0
- package/lib/entity/AcDbRasterImage.js +451 -0
- package/lib/entity/AcDbRasterImage.js.map +1 -0
- package/lib/entity/AcDbRay.d.ts +150 -0
- package/lib/entity/AcDbRay.d.ts.map +1 -0
- package/lib/entity/AcDbRay.js +208 -0
- package/lib/entity/AcDbRay.js.map +1 -0
- package/lib/entity/AcDbSpline.d.ts +135 -0
- package/lib/entity/AcDbSpline.d.ts.map +1 -0
- package/lib/entity/AcDbSpline.js +142 -0
- package/lib/entity/AcDbSpline.js.map +1 -0
- package/lib/entity/AcDbTable.d.ts +260 -0
- package/lib/entity/AcDbTable.d.ts.map +1 -0
- package/lib/entity/AcDbTable.js +452 -0
- package/lib/entity/AcDbTable.js.map +1 -0
- package/lib/entity/AcDbText.d.ts +388 -0
- package/lib/entity/AcDbText.d.ts.map +1 -0
- package/lib/entity/AcDbText.js +523 -0
- package/lib/entity/AcDbText.js.map +1 -0
- package/lib/entity/AcDbTrace.d.ts +193 -0
- package/lib/entity/AcDbTrace.d.ts.map +1 -0
- package/lib/entity/AcDbTrace.js +271 -0
- package/lib/entity/AcDbTrace.js.map +1 -0
- package/lib/entity/AcDbViewport.d.ts +173 -0
- package/lib/entity/AcDbViewport.d.ts.map +1 -0
- package/lib/entity/AcDbViewport.js +295 -0
- package/lib/entity/AcDbViewport.js.map +1 -0
- package/lib/entity/AcDbWipeout.d.ts +39 -0
- package/lib/entity/AcDbWipeout.d.ts.map +1 -0
- package/lib/entity/AcDbWipeout.js +70 -0
- package/lib/entity/AcDbWipeout.js.map +1 -0
- package/lib/entity/AcDbXline.d.ts +151 -0
- package/lib/entity/AcDbXline.d.ts.map +1 -0
- package/lib/entity/AcDbXline.js +209 -0
- package/lib/entity/AcDbXline.js.map +1 -0
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +92 -0
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDb3PointAngularDimension.js +157 -0
- package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts +220 -0
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbAlignedDimension.js +341 -0
- package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbArcDimension.d.ts +94 -0
- package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbArcDimension.js +159 -0
- package/lib/entity/dimension/AcDbArcDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts +145 -0
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbDiametricDimension.js +275 -0
- package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbDimension.d.ts +257 -0
- package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbDimension.js +466 -0
- package/lib/entity/dimension/AcDbDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +78 -0
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbOrdinateDimension.js +133 -0
- package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -0
- package/lib/entity/dimension/AcDbRadialDimension.d.ts +214 -0
- package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -0
- package/lib/entity/dimension/AcDbRadialDimension.js +288 -0
- package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -0
- package/lib/entity/dimension/index.d.ts +8 -0
- package/lib/entity/dimension/index.d.ts.map +1 -0
- package/lib/entity/dimension/index.js +8 -0
- package/lib/entity/dimension/index.js.map +1 -0
- package/lib/entity/index.d.ts +24 -0
- package/lib/entity/index.d.ts.map +1 -0
- package/lib/entity/index.js +24 -0
- package/lib/entity/index.js.map +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/misc/AcDbAngleUnits.d.ts +20 -0
- package/lib/misc/AcDbAngleUnits.d.ts.map +1 -0
- package/lib/misc/AcDbAngleUnits.js +21 -0
- package/lib/misc/AcDbAngleUnits.js.map +1 -0
- package/lib/misc/AcDbCodePage.d.ts +50 -0
- package/lib/misc/AcDbCodePage.d.ts.map +1 -0
- package/lib/misc/AcDbCodePage.js +100 -0
- package/lib/misc/AcDbCodePage.js.map +1 -0
- package/lib/misc/AcDbConstants.d.ts +24 -0
- package/lib/misc/AcDbConstants.d.ts.map +1 -0
- package/lib/misc/AcDbConstants.js +24 -0
- package/lib/misc/AcDbConstants.js.map +1 -0
- package/lib/misc/AcDbDimArrowType.d.ts +89 -0
- package/lib/misc/AcDbDimArrowType.d.ts.map +1 -0
- package/lib/misc/AcDbDimArrowType.js +90 -0
- package/lib/misc/AcDbDimArrowType.js.map +1 -0
- package/lib/misc/AcDbObjectIterator.d.ts +64 -0
- package/lib/misc/AcDbObjectIterator.d.ts.map +1 -0
- package/lib/misc/AcDbObjectIterator.js +84 -0
- package/lib/misc/AcDbObjectIterator.js.map +1 -0
- package/lib/misc/AcDbOsnapMode.d.ts +51 -0
- package/lib/misc/AcDbOsnapMode.d.ts.map +1 -0
- package/lib/misc/AcDbOsnapMode.js +52 -0
- package/lib/misc/AcDbOsnapMode.js.map +1 -0
- package/lib/misc/AcDbRenderingCache.d.ts +141 -0
- package/lib/misc/AcDbRenderingCache.d.ts.map +1 -0
- package/lib/misc/AcDbRenderingCache.js +239 -0
- package/lib/misc/AcDbRenderingCache.js.map +1 -0
- package/lib/misc/AcDbUnitsValue.d.ts +101 -0
- package/lib/misc/AcDbUnitsValue.d.ts.map +1 -0
- package/lib/misc/AcDbUnitsValue.js +121 -0
- package/lib/misc/AcDbUnitsValue.js.map +1 -0
- package/lib/misc/index.d.ts +9 -0
- package/lib/misc/index.d.ts.map +1 -0
- package/lib/misc/index.js +9 -0
- package/lib/misc/index.js.map +1 -0
- package/lib/object/AcDbDictionary.d.ts +178 -0
- package/lib/object/AcDbDictionary.d.ts.map +1 -0
- package/lib/object/AcDbDictionary.js +264 -0
- package/lib/object/AcDbDictionary.js.map +1 -0
- package/lib/object/AcDbRasterImageDef.d.ts +54 -0
- package/lib/object/AcDbRasterImageDef.d.ts.map +1 -0
- package/lib/object/AcDbRasterImageDef.js +82 -0
- package/lib/object/AcDbRasterImageDef.js.map +1 -0
- package/lib/object/index.d.ts +4 -0
- package/lib/object/index.d.ts.map +1 -0
- package/lib/object/index.js +4 -0
- package/lib/object/index.js.map +1 -0
- package/lib/object/layout/AcDbLayout.d.ts +190 -0
- package/lib/object/layout/AcDbLayout.d.ts.map +1 -0
- package/lib/object/layout/AcDbLayout.js +253 -0
- package/lib/object/layout/AcDbLayout.js.map +1 -0
- package/lib/object/layout/AcDbLayoutDictionary.d.ts +47 -0
- package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -0
- package/lib/object/layout/AcDbLayoutDictionary.js +122 -0
- package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -0
- package/lib/object/layout/AcDbLayoutManager.d.ts +188 -0
- package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -0
- package/lib/object/layout/AcDbLayoutManager.js +245 -0
- package/lib/object/layout/AcDbLayoutManager.js.map +1 -0
- package/lib/object/layout/index.d.ts +4 -0
- package/lib/object/layout/index.d.ts.map +1 -0
- package/lib/object/layout/index.js +4 -0
- package/lib/object/layout/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { AcGeBox3d, AcGePoint2d, AcGePoint3d } from '@mlightcad/geometry-engine';
|
|
2
|
+
import { AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a polyline entity in AutoCAD.
|
|
6
|
+
*
|
|
7
|
+
* A polyline is a complex geometric object composed of connected line segments
|
|
8
|
+
* and/or arc segments. Polylines can have:
|
|
9
|
+
* - Straight line segments
|
|
10
|
+
* - Bulge (arc segments) between vertices
|
|
11
|
+
* - Constant and variable width
|
|
12
|
+
* - Thickness
|
|
13
|
+
* - Multiple vertices
|
|
14
|
+
*
|
|
15
|
+
* Polylines are commonly used for creating complex shapes, paths, and boundaries
|
|
16
|
+
* in drawings.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Create a polyline
|
|
21
|
+
* const polyline = new AcDbPolyline();
|
|
22
|
+
*
|
|
23
|
+
* // Add vertices to create a rectangle
|
|
24
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
25
|
+
* polyline.addVertexAt(1, new AcGePoint2d(10, 0));
|
|
26
|
+
* polyline.addVertexAt(2, new AcGePoint2d(10, 5));
|
|
27
|
+
* polyline.addVertexAt(3, new AcGePoint2d(0, 5));
|
|
28
|
+
* polyline.closed = true; // Close the polyline
|
|
29
|
+
*
|
|
30
|
+
* // Access polyline properties
|
|
31
|
+
* console.log(`Number of vertices: ${polyline.numberOfVertices}`);
|
|
32
|
+
* console.log(`Is closed: ${polyline.closed}`);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare class AcDbPolyline extends AcDbCurve {
|
|
36
|
+
/** The entity type name */
|
|
37
|
+
static typeName: string;
|
|
38
|
+
/** The elevation (Z-coordinate) of the polyline plane */
|
|
39
|
+
private _elevation;
|
|
40
|
+
/** The underlying geometric polyline object */
|
|
41
|
+
private _geo;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new empty polyline entity.
|
|
44
|
+
*
|
|
45
|
+
* This constructor initializes an empty polyline with no vertices.
|
|
46
|
+
* Vertices can be added using the addVertexAt method.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const polyline = new AcDbPolyline();
|
|
51
|
+
* // Add vertices as needed
|
|
52
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
constructor();
|
|
56
|
+
/**
|
|
57
|
+
* Gets the number of vertices in this polyline.
|
|
58
|
+
*
|
|
59
|
+
* @returns The number of vertices
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const vertexCount = polyline.numberOfVertices;
|
|
64
|
+
* console.log(`Polyline has ${vertexCount} vertices`);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
get numberOfVertices(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the elevation of this polyline.
|
|
70
|
+
*
|
|
71
|
+
* The elevation is the distance of the polyline's plane from the WCS origin
|
|
72
|
+
* along the Z-axis.
|
|
73
|
+
*
|
|
74
|
+
* @returns The elevation value
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const elevation = polyline.elevation;
|
|
79
|
+
* console.log(`Polyline elevation: ${elevation}`);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
get elevation(): number;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the elevation of this polyline.
|
|
85
|
+
*
|
|
86
|
+
* @param value - The new elevation value
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* polyline.elevation = 10;
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
set elevation(value: number);
|
|
94
|
+
/**
|
|
95
|
+
* Gets whether this polyline is closed.
|
|
96
|
+
*
|
|
97
|
+
* A closed polyline has a segment drawn from the last vertex to the first vertex,
|
|
98
|
+
* forming a complete loop.
|
|
99
|
+
*
|
|
100
|
+
* @returns True if the polyline is closed, false otherwise
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const isClosed = polyline.closed;
|
|
105
|
+
* console.log(`Polyline is closed: ${isClosed}`);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
get closed(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Sets whether this polyline is closed.
|
|
111
|
+
*
|
|
112
|
+
* @param value - True to close the polyline, false to open it
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* polyline.closed = true; // Close the polyline
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
set closed(value: boolean);
|
|
120
|
+
/**
|
|
121
|
+
* Adds a vertex to this polyline at the specified index.
|
|
122
|
+
*
|
|
123
|
+
* This method inserts a vertex at the specified position. If the index is 0,
|
|
124
|
+
* the vertex becomes the first vertex. If the index equals the number of vertices,
|
|
125
|
+
* the vertex becomes the last vertex. Otherwise, the vertex is inserted before
|
|
126
|
+
* the specified index.
|
|
127
|
+
*
|
|
128
|
+
* @param index - The index (0-based) before which to insert the vertex
|
|
129
|
+
* @param pt - The vertex location point
|
|
130
|
+
* @param bulge - The bulge value for the vertex (0 for straight line, >0 for arc)
|
|
131
|
+
* @param startWidth - The starting width for the vertex (-1 for default)
|
|
132
|
+
* @param endWidth - The ending width for the vertex (-1 for default)
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* // Add a straight line vertex
|
|
137
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
138
|
+
*
|
|
139
|
+
* // Add a vertex with arc bulge
|
|
140
|
+
* polyline.addVertexAt(1, new AcGePoint2d(5, 0), 0.5);
|
|
141
|
+
*
|
|
142
|
+
* // Add a vertex with custom width
|
|
143
|
+
* polyline.addVertexAt(2, new AcGePoint2d(10, 0), 0, 2, 1);
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
addVertexAt(index: number, pt: AcGePoint2d, bulge?: number, startWidth?: number, endWidth?: number): void;
|
|
147
|
+
/**
|
|
148
|
+
* Gets the 2D location of a vertex at the specified index.
|
|
149
|
+
*
|
|
150
|
+
* The point is returned in the polyline's own object coordinate system (OCS).
|
|
151
|
+
*
|
|
152
|
+
* @param index - The index (0-based) of the vertex
|
|
153
|
+
* @returns The 2D point location of the vertex
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const point2d = polyline.getPoint2dAt(0);
|
|
158
|
+
* console.log(`Vertex 0: ${point2d.x}, ${point2d.y}`);
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
getPoint2dAt(index: number): AcGePoint2d;
|
|
162
|
+
/**
|
|
163
|
+
* Gets the 3D location of a vertex at the specified index.
|
|
164
|
+
*
|
|
165
|
+
* The point is returned in World Coordinates, with the Z-coordinate
|
|
166
|
+
* set to the polyline's elevation.
|
|
167
|
+
*
|
|
168
|
+
* @param index - The index (0-based) of the vertex
|
|
169
|
+
* @returns The 3D point location of the vertex
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const point3d = polyline.getPoint3dAt(0);
|
|
174
|
+
* console.log(`Vertex 0: ${point3d.x}, ${point3d.y}, ${point3d.z}`);
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
getPoint3dAt(index: number): AcGePoint3d;
|
|
178
|
+
/**
|
|
179
|
+
* Gets the geometric extents (bounding box) of this polyline.
|
|
180
|
+
*
|
|
181
|
+
* @returns The bounding box that encompasses the entire polyline
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const extents = polyline.geometricExtents;
|
|
186
|
+
* console.log(`Polyline bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
get geometricExtents(): AcGeBox3d;
|
|
190
|
+
/**
|
|
191
|
+
* Gets the grip points for this polyline.
|
|
192
|
+
*
|
|
193
|
+
* Grip points are control points that can be used to modify the polyline.
|
|
194
|
+
* For a polyline, the grip points are all the vertices.
|
|
195
|
+
*
|
|
196
|
+
* @returns Array of grip points (all vertices)
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* const gripPoints = polyline.subGetGripPoints();
|
|
201
|
+
* // gripPoints contains all vertices of the polyline
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
subGetGripPoints(): AcGePoint3d[];
|
|
205
|
+
/**
|
|
206
|
+
* Draws this polyline using the specified renderer.
|
|
207
|
+
*
|
|
208
|
+
* This method renders the polyline as a series of connected line segments
|
|
209
|
+
* using the polyline's current style properties.
|
|
210
|
+
*
|
|
211
|
+
* @param renderer - The renderer to use for drawing
|
|
212
|
+
* @returns The rendered polyline entity, or undefined if drawing failed
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const renderedPolyline = polyline.draw(renderer);
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=AcDbPolyline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbPolyline.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbPolyline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EAGZ,MAAM,4BAA4B,CAAA;AACnC,OA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
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcGeBox3d, AcGePoint3d, AcGePolyline2d } from '@mlightcad/geometry-engine';
|
|
17
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
18
|
+
/**
|
|
19
|
+
* Represents a polyline entity in AutoCAD.
|
|
20
|
+
*
|
|
21
|
+
* A polyline is a complex geometric object composed of connected line segments
|
|
22
|
+
* and/or arc segments. Polylines can have:
|
|
23
|
+
* - Straight line segments
|
|
24
|
+
* - Bulge (arc segments) between vertices
|
|
25
|
+
* - Constant and variable width
|
|
26
|
+
* - Thickness
|
|
27
|
+
* - Multiple vertices
|
|
28
|
+
*
|
|
29
|
+
* Polylines are commonly used for creating complex shapes, paths, and boundaries
|
|
30
|
+
* in drawings.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Create a polyline
|
|
35
|
+
* const polyline = new AcDbPolyline();
|
|
36
|
+
*
|
|
37
|
+
* // Add vertices to create a rectangle
|
|
38
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
39
|
+
* polyline.addVertexAt(1, new AcGePoint2d(10, 0));
|
|
40
|
+
* polyline.addVertexAt(2, new AcGePoint2d(10, 5));
|
|
41
|
+
* polyline.addVertexAt(3, new AcGePoint2d(0, 5));
|
|
42
|
+
* polyline.closed = true; // Close the polyline
|
|
43
|
+
*
|
|
44
|
+
* // Access polyline properties
|
|
45
|
+
* console.log(`Number of vertices: ${polyline.numberOfVertices}`);
|
|
46
|
+
* console.log(`Is closed: ${polyline.closed}`);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
var AcDbPolyline = /** @class */ (function (_super) {
|
|
50
|
+
__extends(AcDbPolyline, _super);
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new empty polyline entity.
|
|
53
|
+
*
|
|
54
|
+
* This constructor initializes an empty polyline with no vertices.
|
|
55
|
+
* Vertices can be added using the addVertexAt method.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const polyline = new AcDbPolyline();
|
|
60
|
+
* // Add vertices as needed
|
|
61
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
function AcDbPolyline() {
|
|
65
|
+
var _this = _super.call(this) || this;
|
|
66
|
+
_this._elevation = 0;
|
|
67
|
+
_this._geo = new AcGePolyline2d();
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
Object.defineProperty(AcDbPolyline.prototype, "numberOfVertices", {
|
|
71
|
+
/**
|
|
72
|
+
* Gets the number of vertices in this polyline.
|
|
73
|
+
*
|
|
74
|
+
* @returns The number of vertices
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const vertexCount = polyline.numberOfVertices;
|
|
79
|
+
* console.log(`Polyline has ${vertexCount} vertices`);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
get: function () {
|
|
83
|
+
return this._geo.numberOfVertices;
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(AcDbPolyline.prototype, "elevation", {
|
|
89
|
+
/**
|
|
90
|
+
* Gets the elevation of this polyline.
|
|
91
|
+
*
|
|
92
|
+
* The elevation is the distance of the polyline's plane from the WCS origin
|
|
93
|
+
* along the Z-axis.
|
|
94
|
+
*
|
|
95
|
+
* @returns The elevation value
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const elevation = polyline.elevation;
|
|
100
|
+
* console.log(`Polyline elevation: ${elevation}`);
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
get: function () {
|
|
104
|
+
return this._elevation;
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Sets the elevation of this polyline.
|
|
108
|
+
*
|
|
109
|
+
* @param value - The new elevation value
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* polyline.elevation = 10;
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
set: function (value) {
|
|
117
|
+
this._elevation = value;
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(AcDbPolyline.prototype, "closed", {
|
|
123
|
+
/**
|
|
124
|
+
* Gets whether this polyline is closed.
|
|
125
|
+
*
|
|
126
|
+
* A closed polyline has a segment drawn from the last vertex to the first vertex,
|
|
127
|
+
* forming a complete loop.
|
|
128
|
+
*
|
|
129
|
+
* @returns True if the polyline is closed, false otherwise
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const isClosed = polyline.closed;
|
|
134
|
+
* console.log(`Polyline is closed: ${isClosed}`);
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
get: function () {
|
|
138
|
+
return this._geo.closed;
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* Sets whether this polyline is closed.
|
|
142
|
+
*
|
|
143
|
+
* @param value - True to close the polyline, false to open it
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* polyline.closed = true; // Close the polyline
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
set: function (value) {
|
|
151
|
+
this._geo.closed = value;
|
|
152
|
+
},
|
|
153
|
+
enumerable: false,
|
|
154
|
+
configurable: true
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Adds a vertex to this polyline at the specified index.
|
|
158
|
+
*
|
|
159
|
+
* This method inserts a vertex at the specified position. If the index is 0,
|
|
160
|
+
* the vertex becomes the first vertex. If the index equals the number of vertices,
|
|
161
|
+
* the vertex becomes the last vertex. Otherwise, the vertex is inserted before
|
|
162
|
+
* the specified index.
|
|
163
|
+
*
|
|
164
|
+
* @param index - The index (0-based) before which to insert the vertex
|
|
165
|
+
* @param pt - The vertex location point
|
|
166
|
+
* @param bulge - The bulge value for the vertex (0 for straight line, >0 for arc)
|
|
167
|
+
* @param startWidth - The starting width for the vertex (-1 for default)
|
|
168
|
+
* @param endWidth - The ending width for the vertex (-1 for default)
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* // Add a straight line vertex
|
|
173
|
+
* polyline.addVertexAt(0, new AcGePoint2d(0, 0));
|
|
174
|
+
*
|
|
175
|
+
* // Add a vertex with arc bulge
|
|
176
|
+
* polyline.addVertexAt(1, new AcGePoint2d(5, 0), 0.5);
|
|
177
|
+
*
|
|
178
|
+
* // Add a vertex with custom width
|
|
179
|
+
* polyline.addVertexAt(2, new AcGePoint2d(10, 0), 0, 2, 1);
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
AcDbPolyline.prototype.addVertexAt = function (index, pt, bulge, startWidth, endWidth) {
|
|
183
|
+
if (bulge === void 0) { bulge = 0; }
|
|
184
|
+
if (startWidth === void 0) { startWidth = -1; }
|
|
185
|
+
if (endWidth === void 0) { endWidth = -1; }
|
|
186
|
+
var newStartWidth = startWidth < 0 ? undefined : startWidth;
|
|
187
|
+
var newEndWidth = endWidth < 0 ? undefined : endWidth;
|
|
188
|
+
var vertex = {
|
|
189
|
+
x: pt.x,
|
|
190
|
+
y: pt.y,
|
|
191
|
+
bulge: bulge,
|
|
192
|
+
startWidth: newStartWidth,
|
|
193
|
+
endWidth: newEndWidth
|
|
194
|
+
};
|
|
195
|
+
this._geo.addVertexAt(index, vertex);
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Gets the 2D location of a vertex at the specified index.
|
|
199
|
+
*
|
|
200
|
+
* The point is returned in the polyline's own object coordinate system (OCS).
|
|
201
|
+
*
|
|
202
|
+
* @param index - The index (0-based) of the vertex
|
|
203
|
+
* @returns The 2D point location of the vertex
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const point2d = polyline.getPoint2dAt(0);
|
|
208
|
+
* console.log(`Vertex 0: ${point2d.x}, ${point2d.y}`);
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
AcDbPolyline.prototype.getPoint2dAt = function (index) {
|
|
212
|
+
return this._geo.getPointAt(index);
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Gets the 3D location of a vertex at the specified index.
|
|
216
|
+
*
|
|
217
|
+
* The point is returned in World Coordinates, with the Z-coordinate
|
|
218
|
+
* set to the polyline's elevation.
|
|
219
|
+
*
|
|
220
|
+
* @param index - The index (0-based) of the vertex
|
|
221
|
+
* @returns The 3D point location of the vertex
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* const point3d = polyline.getPoint3dAt(0);
|
|
226
|
+
* console.log(`Vertex 0: ${point3d.x}, ${point3d.y}, ${point3d.z}`);
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
AcDbPolyline.prototype.getPoint3dAt = function (index) {
|
|
230
|
+
var vertex = this.getPoint2dAt(index);
|
|
231
|
+
return new AcGePoint3d(vertex.x, vertex.y, this._elevation);
|
|
232
|
+
};
|
|
233
|
+
Object.defineProperty(AcDbPolyline.prototype, "geometricExtents", {
|
|
234
|
+
/**
|
|
235
|
+
* Gets the geometric extents (bounding box) of this polyline.
|
|
236
|
+
*
|
|
237
|
+
* @returns The bounding box that encompasses the entire polyline
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* const extents = polyline.geometricExtents;
|
|
242
|
+
* console.log(`Polyline bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
get: function () {
|
|
246
|
+
var box = this._geo.box;
|
|
247
|
+
return new AcGeBox3d({ x: box.min.x, y: box.min.y, z: this._elevation }, { x: box.max.x, y: box.max.y, z: this._elevation });
|
|
248
|
+
},
|
|
249
|
+
enumerable: false,
|
|
250
|
+
configurable: true
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* Gets the grip points for this polyline.
|
|
254
|
+
*
|
|
255
|
+
* Grip points are control points that can be used to modify the polyline.
|
|
256
|
+
* For a polyline, the grip points are all the vertices.
|
|
257
|
+
*
|
|
258
|
+
* @returns Array of grip points (all vertices)
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* const gripPoints = polyline.subGetGripPoints();
|
|
263
|
+
* // gripPoints contains all vertices of the polyline
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
AcDbPolyline.prototype.subGetGripPoints = function () {
|
|
267
|
+
var gripPoints = new Array();
|
|
268
|
+
for (var index = 0; index < this.numberOfVertices; ++index) {
|
|
269
|
+
gripPoints.push(this.getPoint3dAt(index));
|
|
270
|
+
}
|
|
271
|
+
return gripPoints;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Draws this polyline using the specified renderer.
|
|
275
|
+
*
|
|
276
|
+
* This method renders the polyline as a series of connected line segments
|
|
277
|
+
* using the polyline's current style properties.
|
|
278
|
+
*
|
|
279
|
+
* @param renderer - The renderer to use for drawing
|
|
280
|
+
* @returns The rendered polyline entity, or undefined if drawing failed
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* const renderedPolyline = polyline.draw(renderer);
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
AcDbPolyline.prototype.draw = function (renderer) {
|
|
288
|
+
var _this = this;
|
|
289
|
+
var points = [];
|
|
290
|
+
var tmp = this._geo.getPoints(100);
|
|
291
|
+
tmp.forEach(function (point) {
|
|
292
|
+
return points.push(new AcGePoint3d().set(point.x, point.y, _this.elevation));
|
|
293
|
+
});
|
|
294
|
+
return renderer.lines(points, this.lineStyle);
|
|
295
|
+
};
|
|
296
|
+
/** The entity type name */
|
|
297
|
+
AcDbPolyline.typeName = 'Polyline';
|
|
298
|
+
return AcDbPolyline;
|
|
299
|
+
}(AcDbCurve));
|
|
300
|
+
export { AcDbPolyline };
|
|
301
|
+
//# sourceMappingURL=AcDbPolyline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbPolyline.js","sourceRoot":"","sources":["../../src/entity/AcDbPolyline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EAET,WAAW,EACX,cAAc,EAEf,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAevC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAAkC,gCAAS;IASzC;;;;;;;;;;;;OAYG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,UAAU,GAAG,CAAC,CAAA;QACnB,KAAI,CAAC,IAAI,GAAG,IAAI,cAAc,EAAE,CAAA;;IAClC,CAAC;IAaD,sBAAI,0CAAgB;QAXpB;;;;;;;;;;WAUG;aACH;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CA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