@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,150 @@
|
|
|
1
|
+
import { AcGeBox3d, AcGePoint3d } from '@mlightcad/geometry-engine';
|
|
2
|
+
import { AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a ray entity in AutoCAD.
|
|
6
|
+
*
|
|
7
|
+
* A ray is a 3D geometric object that extends infinitely in one direction from a base point.
|
|
8
|
+
* Rays are commonly used for construction lines, reference lines, and temporary geometry.
|
|
9
|
+
* Unlike lines, rays have no end point and extend to infinity.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Create a ray from origin in the positive X direction
|
|
14
|
+
* const ray = new AcDbRay();
|
|
15
|
+
* ray.basePoint = new AcGePoint3d(0, 0, 0);
|
|
16
|
+
* ray.unitDir = new AcGeVector3d(1, 0, 0);
|
|
17
|
+
*
|
|
18
|
+
* // Access ray properties
|
|
19
|
+
* console.log(`Base point: ${ray.basePoint}`);
|
|
20
|
+
* console.log(`Unit direction: ${ray.unitDir}`);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class AcDbRay extends AcDbCurve {
|
|
24
|
+
/** The entity type name */
|
|
25
|
+
static typeName: string;
|
|
26
|
+
/** The base point of the ray */
|
|
27
|
+
private _basePoint;
|
|
28
|
+
/** The unit direction vector of the ray */
|
|
29
|
+
private _unitDir;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new ray entity.
|
|
32
|
+
*
|
|
33
|
+
* This constructor initializes a ray with default values.
|
|
34
|
+
* The base point is at the origin and the unit direction is undefined.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const ray = new AcDbRay();
|
|
39
|
+
* ray.basePoint = new AcGePoint3d(5, 10, 0);
|
|
40
|
+
* ray.unitDir = new AcGeVector3d(0, 1, 0); // Positive Y direction
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
constructor();
|
|
44
|
+
/**
|
|
45
|
+
* Gets the base point of this ray.
|
|
46
|
+
*
|
|
47
|
+
* The base point is the starting point from which the ray extends infinitely.
|
|
48
|
+
*
|
|
49
|
+
* @returns The base point as a 3D point
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const basePoint = ray.basePoint;
|
|
54
|
+
* console.log(`Ray base point: ${basePoint.x}, ${basePoint.y}, ${basePoint.z}`);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
get basePoint(): AcGePoint3d;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the base point of this ray.
|
|
60
|
+
*
|
|
61
|
+
* @param value - The new base point
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* ray.basePoint = new AcGePoint3d(10, 20, 0);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
set basePoint(value: AcGePoint3d);
|
|
69
|
+
/**
|
|
70
|
+
* Gets the unit direction vector of this ray.
|
|
71
|
+
*
|
|
72
|
+
* The unit direction vector defines the direction in which the ray extends
|
|
73
|
+
* infinitely from the base point.
|
|
74
|
+
*
|
|
75
|
+
* @returns The unit direction vector
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const unitDir = ray.unitDir;
|
|
80
|
+
* console.log(`Ray direction: ${unitDir.x}, ${unitDir.y}, ${unitDir.z}`);
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
get unitDir(): AcGePoint3d;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the unit direction vector of this ray.
|
|
86
|
+
*
|
|
87
|
+
* @param value - The new unit direction vector
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* ray.unitDir = new AcGeVector3d(0, 0, 1); // Positive Z direction
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
set unitDir(value: AcGePoint3d);
|
|
95
|
+
/**
|
|
96
|
+
* Gets whether this ray is closed.
|
|
97
|
+
*
|
|
98
|
+
* Rays are always open entities, so this always returns false.
|
|
99
|
+
*
|
|
100
|
+
* @returns Always false for rays
|
|
101
|
+
*/
|
|
102
|
+
get closed(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Gets the geometric extents (bounding box) of this ray.
|
|
105
|
+
*
|
|
106
|
+
* Since rays extend infinitely, this method returns a bounding box that
|
|
107
|
+
* encompasses a finite portion of the ray for practical purposes.
|
|
108
|
+
*
|
|
109
|
+
* @returns The bounding box that encompasses a portion of the ray
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const extents = ray.geometricExtents;
|
|
114
|
+
* console.log(`Ray bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
get geometricExtents(): AcGeBox3d;
|
|
118
|
+
/**
|
|
119
|
+
* Gets the grip points for this ray.
|
|
120
|
+
*
|
|
121
|
+
* Grip points are control points that can be used to modify the ray.
|
|
122
|
+
* For a ray, the grip point is the base point.
|
|
123
|
+
*
|
|
124
|
+
* @returns Array of grip points (base point)
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const gripPoints = ray.subGetGripPoints();
|
|
129
|
+
* // gripPoints contains: [basePoint]
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
subGetGripPoints(): AcGePoint3d[];
|
|
133
|
+
/**
|
|
134
|
+
* Draws this ray using the specified renderer.
|
|
135
|
+
*
|
|
136
|
+
* This method renders the ray as a line segment extending from the base point
|
|
137
|
+
* in the direction of the unit vector. For practical purposes, the ray is
|
|
138
|
+
* drawn with a finite length.
|
|
139
|
+
*
|
|
140
|
+
* @param renderer - The renderer to use for drawing
|
|
141
|
+
* @returns The rendered ray entity, or undefined if drawing failed
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const renderedRay = ray.draw(renderer);
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=AcDbRay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbRay.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbRay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EAEZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,OAAQ,SAAQ,SAAS;IACpC,2BAA2B;IAC3B,OAAgB,QAAQ,EAAE,MAAM,CAAQ;IAExC,gCAAgC;IAChC,OAAO,CAAC,UAAU,CAAa;IAC/B,2CAA2C;IAC3C,OAAO,CAAC,QAAQ,CAAc;IAE9B;;;;;;;;;;;;OAYG;;IAOH;;;;;;;;;;;;OAYG;IACH,IAAI,SAAS,IAcQ,WAAW,CAZ/B;IAED;;;;;;;;;OASG;IACH,IAAI,SAAS,CAAC,KAAK,EAAE,WAAW,EAE/B;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,OAAO,IAcQ,WAAW,CAZ7B;IAED;;;;;;;;;OASG;IACH,IAAI,OAAO,CAAC,KAAK,EAAE,WAAW,EAE7B;IAED;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAShC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB;IAMhB;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAQ5B"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
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, AcGeVector3d } from '@mlightcad/geometry-engine';
|
|
17
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
18
|
+
/**
|
|
19
|
+
* Represents a ray entity in AutoCAD.
|
|
20
|
+
*
|
|
21
|
+
* A ray is a 3D geometric object that extends infinitely in one direction from a base point.
|
|
22
|
+
* Rays are commonly used for construction lines, reference lines, and temporary geometry.
|
|
23
|
+
* Unlike lines, rays have no end point and extend to infinity.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Create a ray from origin in the positive X direction
|
|
28
|
+
* const ray = new AcDbRay();
|
|
29
|
+
* ray.basePoint = new AcGePoint3d(0, 0, 0);
|
|
30
|
+
* ray.unitDir = new AcGeVector3d(1, 0, 0);
|
|
31
|
+
*
|
|
32
|
+
* // Access ray properties
|
|
33
|
+
* console.log(`Base point: ${ray.basePoint}`);
|
|
34
|
+
* console.log(`Unit direction: ${ray.unitDir}`);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
var AcDbRay = /** @class */ (function (_super) {
|
|
38
|
+
__extends(AcDbRay, _super);
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new ray entity.
|
|
41
|
+
*
|
|
42
|
+
* This constructor initializes a ray with default values.
|
|
43
|
+
* The base point is at the origin and the unit direction is undefined.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const ray = new AcDbRay();
|
|
48
|
+
* ray.basePoint = new AcGePoint3d(5, 10, 0);
|
|
49
|
+
* ray.unitDir = new AcGeVector3d(0, 1, 0); // Positive Y direction
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
function AcDbRay() {
|
|
53
|
+
var _this = _super.call(this) || this;
|
|
54
|
+
_this._basePoint = new AcGePoint3d();
|
|
55
|
+
_this._unitDir = new AcGeVector3d();
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
Object.defineProperty(AcDbRay.prototype, "basePoint", {
|
|
59
|
+
/**
|
|
60
|
+
* Gets the base point of this ray.
|
|
61
|
+
*
|
|
62
|
+
* The base point is the starting point from which the ray extends infinitely.
|
|
63
|
+
*
|
|
64
|
+
* @returns The base point as a 3D point
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const basePoint = ray.basePoint;
|
|
69
|
+
* console.log(`Ray base point: ${basePoint.x}, ${basePoint.y}, ${basePoint.z}`);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
get: function () {
|
|
73
|
+
return this._basePoint;
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Sets the base point of this ray.
|
|
77
|
+
*
|
|
78
|
+
* @param value - The new base point
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* ray.basePoint = new AcGePoint3d(10, 20, 0);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
set: function (value) {
|
|
86
|
+
this._basePoint.copy(value);
|
|
87
|
+
},
|
|
88
|
+
enumerable: false,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(AcDbRay.prototype, "unitDir", {
|
|
92
|
+
/**
|
|
93
|
+
* Gets the unit direction vector of this ray.
|
|
94
|
+
*
|
|
95
|
+
* The unit direction vector defines the direction in which the ray extends
|
|
96
|
+
* infinitely from the base point.
|
|
97
|
+
*
|
|
98
|
+
* @returns The unit direction vector
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const unitDir = ray.unitDir;
|
|
103
|
+
* console.log(`Ray direction: ${unitDir.x}, ${unitDir.y}, ${unitDir.z}`);
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
get: function () {
|
|
107
|
+
return this._unitDir;
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Sets the unit direction vector of this ray.
|
|
111
|
+
*
|
|
112
|
+
* @param value - The new unit direction vector
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* ray.unitDir = new AcGeVector3d(0, 0, 1); // Positive Z direction
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
set: function (value) {
|
|
120
|
+
this._unitDir.copy(value);
|
|
121
|
+
},
|
|
122
|
+
enumerable: false,
|
|
123
|
+
configurable: true
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(AcDbRay.prototype, "closed", {
|
|
126
|
+
/**
|
|
127
|
+
* Gets whether this ray is closed.
|
|
128
|
+
*
|
|
129
|
+
* Rays are always open entities, so this always returns false.
|
|
130
|
+
*
|
|
131
|
+
* @returns Always false for rays
|
|
132
|
+
*/
|
|
133
|
+
get: function () {
|
|
134
|
+
return false;
|
|
135
|
+
},
|
|
136
|
+
enumerable: false,
|
|
137
|
+
configurable: true
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(AcDbRay.prototype, "geometricExtents", {
|
|
140
|
+
/**
|
|
141
|
+
* Gets the geometric extents (bounding box) of this ray.
|
|
142
|
+
*
|
|
143
|
+
* Since rays extend infinitely, this method returns a bounding box that
|
|
144
|
+
* encompasses a finite portion of the ray for practical purposes.
|
|
145
|
+
*
|
|
146
|
+
* @returns The bounding box that encompasses a portion of the ray
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const extents = ray.geometricExtents;
|
|
151
|
+
* console.log(`Ray bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
get: function () {
|
|
155
|
+
var extents = new AcGeBox3d();
|
|
156
|
+
extents.expandByPoint(this._unitDir.clone().multiplyScalar(10).add(this._basePoint));
|
|
157
|
+
extents.expandByPoint(this._unitDir.clone().multiplyScalar(-10).add(this._basePoint));
|
|
158
|
+
return extents;
|
|
159
|
+
},
|
|
160
|
+
enumerable: false,
|
|
161
|
+
configurable: true
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* Gets the grip points for this ray.
|
|
165
|
+
*
|
|
166
|
+
* Grip points are control points that can be used to modify the ray.
|
|
167
|
+
* For a ray, the grip point is the base point.
|
|
168
|
+
*
|
|
169
|
+
* @returns Array of grip points (base point)
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const gripPoints = ray.subGetGripPoints();
|
|
174
|
+
* // gripPoints contains: [basePoint]
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
AcDbRay.prototype.subGetGripPoints = function () {
|
|
178
|
+
var gripPoints = new Array();
|
|
179
|
+
gripPoints.push(this.basePoint);
|
|
180
|
+
return gripPoints;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Draws this ray using the specified renderer.
|
|
184
|
+
*
|
|
185
|
+
* This method renders the ray as a line segment extending from the base point
|
|
186
|
+
* in the direction of the unit vector. For practical purposes, the ray is
|
|
187
|
+
* drawn with a finite length.
|
|
188
|
+
*
|
|
189
|
+
* @param renderer - The renderer to use for drawing
|
|
190
|
+
* @returns The rendered ray entity, or undefined if drawing failed
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const renderedRay = ray.draw(renderer);
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
AcDbRay.prototype.draw = function (renderer) {
|
|
198
|
+
var points = [];
|
|
199
|
+
points.push(this.basePoint);
|
|
200
|
+
points.push(this._unitDir.clone().multiplyScalar(1000000).add(this._basePoint));
|
|
201
|
+
return renderer.lines(points, this.lineStyle);
|
|
202
|
+
};
|
|
203
|
+
/** The entity type name */
|
|
204
|
+
AcDbRay.typeName = 'Ray';
|
|
205
|
+
return AcDbRay;
|
|
206
|
+
}(AcDbCurve));
|
|
207
|
+
export { AcDbRay };
|
|
208
|
+
//# sourceMappingURL=AcDbRay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbRay.js","sourceRoot":"","sources":["../../src/entity/AcDbRay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACb,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAA6B,2BAAS;IASpC;;;;;;;;;;;;OAYG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,UAAU,GAAG,IAAI,WAAW,EAAE,CAAA;QACnC,KAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAA;;IACpC,CAAC;IAeD,sBAAI,8BAAS;QAbb;;;;;;;;;;;;WAYG;aACH;YACE,OAAO,IAAI,CAAC,UAAU,CAAA;QACxB,CAAC;QAED;;;;;;;;;WASG;aACH,UAAc,KAAkB;YAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC7B,CAAC;;;OAdA;IA8BD,sBAAI,4BAAO;QAdX;;;;;;;;;;;;;WAaG;aACH;YACE,OAAO,IAAI,CAAC,QAAQ,CAAA;QACtB,CAAC;QAED;;;;;;;;;WASG;aACH,UAAY,KAAkB;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,CAAC;;;OAdA;IAuBD,sBAAI,2BAAM;QAPV;;;;;;WAMG;aACH;YACE,OAAO,KAAK,CAAA;QACd,CAAC;;;OAAA;IAgBD,sBAAI,qCAAgB;QAdpB;;;;;;;;;;;;;WAaG;aACH;YACE,IAAM,OAAO,GAAG,IAAI,SAAS,EAAE,CAAA;YAC/B,OAAO,CAAC,aAAa,CACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAC9D,CAAA;YACD,OAAO,CAAC,aAAa,CACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAC/D,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;;;OAAA;IAED;;;;;;;;;;;;;OAaG;IACH,kCAAgB,GAAhB;QACE,IAAM,UAAU,GAAG,IAAI,KAAK,EAAe,CAAA;QAC3C,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC/B,OAAO,UAAU,CAAA;IACnB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,sBAAI,GAAJ,UAAK,QAAsB;QACzB,IAAM,MAAM,GAAkB,EAAE,CAAA;QAChC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC3B,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CACnE,CAAA;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IAC/C,CAAC;IAxKD,2BAA2B;IACX,gBAAQ,GAAW,KAAK,CAAA;IAwK1C,cAAC;CAAA,AA1KD,CAA6B,SAAS,GA0KrC;SA1KY,OAAO"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { AcGeKnotParameterizationType, AcGePoint3dLike } from '@mlightcad/geometry-engine';
|
|
2
|
+
import { AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a spline entity in AutoCAD.
|
|
6
|
+
*
|
|
7
|
+
* A spline is a 3D geometric object defined by control points or fit points.
|
|
8
|
+
* Splines are smooth curves that can be used to create complex curved shapes
|
|
9
|
+
* in drawings. They can be either open or closed curves.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Create a spline from control points
|
|
14
|
+
* const controlPoints = [
|
|
15
|
+
* new AcGePoint3d(0, 0, 0),
|
|
16
|
+
* new AcGePoint3d(5, 5, 0),
|
|
17
|
+
* new AcGePoint3d(10, 0, 0)
|
|
18
|
+
* ];
|
|
19
|
+
* const knots = [0, 0, 0, 1, 1, 1];
|
|
20
|
+
* const spline = new AcDbSpline(controlPoints, knots);
|
|
21
|
+
*
|
|
22
|
+
* // Create a spline from fit points
|
|
23
|
+
* const fitPoints = [
|
|
24
|
+
* new AcGePoint3d(0, 0, 0),
|
|
25
|
+
* new AcGePoint3d(5, 5, 0),
|
|
26
|
+
* new AcGePoint3d(10, 0, 0)
|
|
27
|
+
* ];
|
|
28
|
+
* const spline2 = new AcDbSpline(fitPoints, AcGeKnotParameterizationType.Uniform);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class AcDbSpline extends AcDbCurve {
|
|
32
|
+
/** The entity type name */
|
|
33
|
+
static typeName: string;
|
|
34
|
+
/** The underlying geometric spline object */
|
|
35
|
+
private _geo;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new spline entity from control points.
|
|
38
|
+
*
|
|
39
|
+
* This constructor creates a spline using the specified control points, knots,
|
|
40
|
+
* and optional weights. The control points must be in World Coordinate System (WCS) coordinates.
|
|
41
|
+
*
|
|
42
|
+
* @param controlPoints - Array of control points in WCS coordinates
|
|
43
|
+
* @param knots - Array of knot values that define the spline's parameterization
|
|
44
|
+
* @param weights - Optional array of weights for each control point (default: 1 for all)
|
|
45
|
+
* @param degree - Optional degree of the spline (default: 3)
|
|
46
|
+
* @param closed - Whether the spline should be closed (default: false)
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const controlPoints = [
|
|
51
|
+
* new AcGePoint3d(0, 0, 0),
|
|
52
|
+
* new AcGePoint3d(5, 5, 0),
|
|
53
|
+
* new AcGePoint3d(10, 0, 0)
|
|
54
|
+
* ];
|
|
55
|
+
* const knots = [0, 0, 0, 1, 1, 1];
|
|
56
|
+
* const spline = new AcDbSpline(controlPoints, knots);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
constructor(controlPoints: AcGePoint3dLike[], knots: number[], weights?: number[], degree?: number, closed?: boolean);
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new spline entity from fit points.
|
|
62
|
+
*
|
|
63
|
+
* This constructor creates a spline that passes through the specified fit points.
|
|
64
|
+
* The fit points must be in World Coordinate System (WCS) coordinates.
|
|
65
|
+
*
|
|
66
|
+
* @param fitPoints - Array of fit points in WCS coordinates
|
|
67
|
+
* @param knotParam - Knot parameterization type that defines how knots are generated
|
|
68
|
+
* @param degree - Optional degree of the spline (default: 3)
|
|
69
|
+
* @param closed - Whether the spline should be closed (default: false)
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const fitPoints = [
|
|
74
|
+
* new AcGePoint3d(0, 0, 0),
|
|
75
|
+
* new AcGePoint3d(5, 5, 0),
|
|
76
|
+
* new AcGePoint3d(10, 0, 0)
|
|
77
|
+
* ];
|
|
78
|
+
* const spline = new AcDbSpline(fitPoints, AcGeKnotParameterizationType.Uniform);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
constructor(fitPoints: AcGePoint3dLike[], knotParam: AcGeKnotParameterizationType, degree?: number, closed?: boolean);
|
|
82
|
+
/**
|
|
83
|
+
* Gets the geometric extents (bounding box) of this spline.
|
|
84
|
+
*
|
|
85
|
+
* @returns The bounding box that encompasses the entire spline
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const extents = spline.geometricExtents;
|
|
90
|
+
* console.log(`Spline bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
get geometricExtents(): import("@mlightcad/geometry-engine").AcGeBox3d;
|
|
94
|
+
/**
|
|
95
|
+
* Gets whether this spline is closed.
|
|
96
|
+
*
|
|
97
|
+
* A closed spline forms a complete loop where the end point connects to the start point.
|
|
98
|
+
*
|
|
99
|
+
* @returns True if the spline is closed, false otherwise
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const isClosed = spline.closed;
|
|
104
|
+
* console.log(`Spline is closed: ${isClosed}`);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
get closed(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Sets whether this spline is closed.
|
|
110
|
+
*
|
|
111
|
+
* @param value - True to close the spline, false to open it
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* spline.closed = true; // Close the spline
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
set closed(value: boolean);
|
|
119
|
+
/**
|
|
120
|
+
* Draws this spline using the specified renderer.
|
|
121
|
+
*
|
|
122
|
+
* This method renders the spline as a series of connected line segments
|
|
123
|
+
* using the spline's current style properties.
|
|
124
|
+
*
|
|
125
|
+
* @param renderer - The renderer to use for drawing
|
|
126
|
+
* @returns The rendered spline entity, or undefined if drawing failed
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const renderedSpline = spline.draw(renderer);
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=AcDbSpline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbSpline.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbSpline.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,EAC5B,eAAe,EAEhB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,2BAA2B;IAC3B,OAAgB,QAAQ,EAAE,MAAM,CAAW;IAE3C,6CAA6C;IAC7C,OAAO,CAAC,IAAI,CAAc;IAE1B;;;;;;;;;;;;;;;;;;;;;;OAsBG;gBAED,aAAa,EAAE,eAAe,EAAE,EAChC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,OAAO;IAElB;;;;;;;;;;;;;;;;;;;;OAoBG;gBAED,SAAS,EAAE,eAAe,EAAE,EAC5B,SAAS,EAAE,4BAA4B,EACvC,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,OAAO;IAoClB;;;;;;;;;;OAUG;IACH,IAAI,gBAAgB,mDAEnB;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;;;;;OASG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAI5B"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
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 { AcCmErrors } from '@mlightcad/common';
|
|
17
|
+
import { AcGeSpline3d } from '@mlightcad/geometry-engine';
|
|
18
|
+
import { AcDbCurve } from './AcDbCurve';
|
|
19
|
+
/**
|
|
20
|
+
* Represents a spline entity in AutoCAD.
|
|
21
|
+
*
|
|
22
|
+
* A spline is a 3D geometric object defined by control points or fit points.
|
|
23
|
+
* Splines are smooth curves that can be used to create complex curved shapes
|
|
24
|
+
* in drawings. They can be either open or closed curves.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Create a spline from control points
|
|
29
|
+
* const controlPoints = [
|
|
30
|
+
* new AcGePoint3d(0, 0, 0),
|
|
31
|
+
* new AcGePoint3d(5, 5, 0),
|
|
32
|
+
* new AcGePoint3d(10, 0, 0)
|
|
33
|
+
* ];
|
|
34
|
+
* const knots = [0, 0, 0, 1, 1, 1];
|
|
35
|
+
* const spline = new AcDbSpline(controlPoints, knots);
|
|
36
|
+
*
|
|
37
|
+
* // Create a spline from fit points
|
|
38
|
+
* const fitPoints = [
|
|
39
|
+
* new AcGePoint3d(0, 0, 0),
|
|
40
|
+
* new AcGePoint3d(5, 5, 0),
|
|
41
|
+
* new AcGePoint3d(10, 0, 0)
|
|
42
|
+
* ];
|
|
43
|
+
* const spline2 = new AcDbSpline(fitPoints, AcGeKnotParameterizationType.Uniform);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
var AcDbSpline = /** @class */ (function (_super) {
|
|
47
|
+
__extends(AcDbSpline, _super);
|
|
48
|
+
function AcDbSpline(a, b, c, d, e) {
|
|
49
|
+
var _this = _super.call(this) || this;
|
|
50
|
+
var argsLength = +(a !== undefined) +
|
|
51
|
+
+(b !== undefined) +
|
|
52
|
+
+(c !== undefined) +
|
|
53
|
+
+(d !== undefined) +
|
|
54
|
+
+(e !== undefined);
|
|
55
|
+
if (argsLength < 2 || argsLength > 5) {
|
|
56
|
+
throw AcCmErrors.ILLEGAL_PARAMETERS;
|
|
57
|
+
}
|
|
58
|
+
// Determine if this is the fitPoints constructor (second arg is not an array)
|
|
59
|
+
var isFitPointsConstructor = !Array.isArray(b);
|
|
60
|
+
if (isFitPointsConstructor) {
|
|
61
|
+
_this._geo = new AcGeSpline3d(a, b, c, d);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
_this._geo = new AcGeSpline3d(a, b, c, d, e);
|
|
65
|
+
}
|
|
66
|
+
return _this;
|
|
67
|
+
}
|
|
68
|
+
Object.defineProperty(AcDbSpline.prototype, "geometricExtents", {
|
|
69
|
+
/**
|
|
70
|
+
* Gets the geometric extents (bounding box) of this spline.
|
|
71
|
+
*
|
|
72
|
+
* @returns The bounding box that encompasses the entire spline
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const extents = spline.geometricExtents;
|
|
77
|
+
* console.log(`Spline bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
get: function () {
|
|
81
|
+
return this._geo.box;
|
|
82
|
+
},
|
|
83
|
+
enumerable: false,
|
|
84
|
+
configurable: true
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(AcDbSpline.prototype, "closed", {
|
|
87
|
+
/**
|
|
88
|
+
* Gets whether this spline is closed.
|
|
89
|
+
*
|
|
90
|
+
* A closed spline forms a complete loop where the end point connects to the start point.
|
|
91
|
+
*
|
|
92
|
+
* @returns True if the spline is closed, false otherwise
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const isClosed = spline.closed;
|
|
97
|
+
* console.log(`Spline is closed: ${isClosed}`);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
get: function () {
|
|
101
|
+
return this._geo.closed;
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Sets whether this spline is closed.
|
|
105
|
+
*
|
|
106
|
+
* @param value - True to close the spline, false to open it
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* spline.closed = true; // Close the spline
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
set: function (value) {
|
|
114
|
+
this._geo.closed = value;
|
|
115
|
+
},
|
|
116
|
+
enumerable: false,
|
|
117
|
+
configurable: true
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* Draws this spline using the specified renderer.
|
|
121
|
+
*
|
|
122
|
+
* This method renders the spline as a series of connected line segments
|
|
123
|
+
* using the spline's current style properties.
|
|
124
|
+
*
|
|
125
|
+
* @param renderer - The renderer to use for drawing
|
|
126
|
+
* @returns The rendered spline entity, or undefined if drawing failed
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const renderedSpline = spline.draw(renderer);
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
AcDbSpline.prototype.draw = function (renderer) {
|
|
134
|
+
var points = this._geo.getPoints(100);
|
|
135
|
+
return renderer.lines(points, this.lineStyle);
|
|
136
|
+
};
|
|
137
|
+
/** The entity type name */
|
|
138
|
+
AcDbSpline.typeName = 'Spline';
|
|
139
|
+
return AcDbSpline;
|
|
140
|
+
}(AcDbCurve));
|
|
141
|
+
export { AcDbSpline };
|
|
142
|
+
//# sourceMappingURL=AcDbSpline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbSpline.js","sourceRoot":"","sources":["../../src/entity/AcDbSpline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAGL,YAAY,EACb,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAAgC,8BAAS;IAgEvC,oBAAY,CAAW,EAAE,CAAW,EAAE,CAAW,EAAE,CAAW,EAAE,CAAW;QACzE,YAAA,MAAK,WAAE,SAAA;QACP,IAAM,UAAU,GACd,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;YAClB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;YAClB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;YAClB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;YAClB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAA;QAEpB,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,UAAU,CAAC,kBAAkB,CAAA;QACrC,CAAC;QAED,8EAA8E;QAC9E,IAAM,sBAAsB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAEhD,IAAI,sBAAsB,EAAE,CAAC;YAC3B,KAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAC1B,CAAsB,EACtB,CAAiC,EACjC,CAAuB,EACvB,CAAwB,CACzB,CAAA;QACH,CAAC;aAAM,CAAC;YACN,KAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAC1B,CAAsB,EACtB,CAAa,EACb,CAAyB,EACzB,CAAuB,EACvB,CAAwB,CACzB,CAAA;QACH,CAAC;;IACH,CAAC;IAaD,sBAAI,wCAAgB;QAXpB;;;;;;;;;;WAUG;aACH;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;QACtB,CAAC;;;OAAA;IAeD,sBAAI,8BAAM;QAbV;;;;;;;;;;;;WAYG;aACH;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;QACzB,CAAC;QAED;;;;;;;;;WASG;aACH,UAAW,KAAc;YACvB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QAC1B,CAAC;;;OAdA;IAgBD;;;;;;;;;;;;;OAaG;IACH,yBAAI,GAAJ,UAAK,QAAsB;QACzB,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IAC/C,CAAC;IAhKD,2BAA2B;IACX,mBAAQ,GAAW,QAAQ,CAAA;IAgK7C,iBAAC;CAAA,AAlKD,CAAgC,SAAS,GAkKxC;SAlKY,UAAU"}
|