@mlightcad/data-model 1.1.2 → 1.1.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.js +5501 -1021
- package/dist/data-model.umd.cjs +2 -2
- package/lib/base/AcDbHostApplicationServices.d.ts +72 -6
- package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -1
- package/lib/base/AcDbHostApplicationServices.js +71 -7
- package/lib/base/AcDbHostApplicationServices.js.map +1 -1
- package/lib/base/AcDbObject.d.ts +160 -25
- package/lib/base/AcDbObject.d.ts.map +1 -1
- package/lib/base/AcDbObject.js +149 -25
- package/lib/base/AcDbObject.js.map +1 -1
- package/lib/converter/AcDbBatchProcessing.d.ts +112 -10
- package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -1
- package/lib/converter/AcDbBatchProcessing.js +110 -11
- package/lib/converter/AcDbBatchProcessing.js.map +1 -1
- package/lib/converter/AcDbDxfConverter.d.ts +224 -6
- package/lib/converter/AcDbDxfConverter.d.ts.map +1 -1
- package/lib/converter/AcDbDxfConverter.js +224 -6
- package/lib/converter/AcDbDxfConverter.js.map +1 -1
- package/lib/converter/AcDbDxfParseWorker.d.ts +16 -0
- package/lib/converter/AcDbDxfParseWorker.d.ts.map +1 -1
- package/lib/converter/AcDbDxfParseWorker.js +16 -0
- package/lib/converter/AcDbDxfParseWorker.js.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.d.ts +118 -3
- package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.js +118 -3
- package/lib/converter/AcDbEntitiyConverter.js.map +1 -1
- package/lib/converter/AcDbObjectConverter.d.ts +52 -0
- package/lib/converter/AcDbObjectConverter.d.ts.map +1 -1
- package/lib/converter/AcDbObjectConverter.js +52 -0
- package/lib/converter/AcDbObjectConverter.js.map +1 -1
- package/lib/database/AcDbBlockTable.d.ts +35 -3
- package/lib/database/AcDbBlockTable.d.ts.map +1 -1
- package/lib/database/AcDbBlockTable.js +35 -3
- package/lib/database/AcDbBlockTable.js.map +1 -1
- package/lib/database/AcDbBlockTableRecord.d.ts +98 -15
- package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbBlockTableRecord.js +96 -15
- package/lib/database/AcDbBlockTableRecord.js.map +1 -1
- package/lib/database/AcDbDatabase.d.ts +312 -36
- package/lib/database/AcDbDatabase.d.ts.map +1 -1
- package/lib/database/AcDbDatabase.js +237 -46
- package/lib/database/AcDbDatabase.js.map +1 -1
- package/lib/database/AcDbDatabaseConverter.d.ts +79 -14
- package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -1
- package/lib/database/AcDbDatabaseConverter.js +46 -13
- package/lib/database/AcDbDatabaseConverter.js.map +1 -1
- package/lib/database/AcDbDatabaseConverterManager.d.ts +97 -15
- package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -1
- package/lib/database/AcDbDatabaseConverterManager.js +90 -15
- package/lib/database/AcDbDatabaseConverterManager.js.map +1 -1
- package/lib/database/AcDbDimStyleTable.d.ts +22 -2
- package/lib/database/AcDbDimStyleTable.d.ts.map +1 -1
- package/lib/database/AcDbDimStyleTable.js +22 -2
- package/lib/database/AcDbDimStyleTable.js.map +1 -1
- package/lib/database/AcDbDimStyleTableRecord.d.ts +115 -0
- package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbDimStyleTableRecord.js +44 -0
- package/lib/database/AcDbDimStyleTableRecord.js.map +1 -1
- package/lib/database/AcDbLayerTable.d.ts +39 -2
- package/lib/database/AcDbLayerTable.d.ts.map +1 -1
- package/lib/database/AcDbLayerTable.js +39 -2
- package/lib/database/AcDbLayerTable.js.map +1 -1
- package/lib/database/AcDbLayerTableRecord.d.ts +198 -18
- package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbLayerTableRecord.js +182 -19
- package/lib/database/AcDbLayerTableRecord.js.map +1 -1
- package/lib/database/AcDbLinetypeTable.d.ts +21 -2
- package/lib/database/AcDbLinetypeTable.d.ts.map +1 -1
- package/lib/database/AcDbLinetypeTable.js +21 -2
- package/lib/database/AcDbLinetypeTable.js.map +1 -1
- package/lib/database/AcDbLinetypeTableRecord.d.ts +46 -14
- package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbLinetypeTableRecord.js +46 -14
- package/lib/database/AcDbLinetypeTableRecord.js.map +1 -1
- package/lib/database/AcDbSymbolTable.d.ts +134 -29
- package/lib/database/AcDbSymbolTable.d.ts.map +1 -1
- package/lib/database/AcDbSymbolTable.js +133 -37
- package/lib/database/AcDbSymbolTable.js.map +1 -1
- package/lib/database/AcDbSymbolTableRecord.d.ts +47 -2
- package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbSymbolTableRecord.js +40 -2
- package/lib/database/AcDbSymbolTableRecord.js.map +1 -1
- package/lib/database/AcDbTextStyleTable.d.ts +36 -2
- package/lib/database/AcDbTextStyleTable.d.ts.map +1 -1
- package/lib/database/AcDbTextStyleTable.js +36 -2
- package/lib/database/AcDbTextStyleTable.js.map +1 -1
- package/lib/database/AcDbTextStyleTableRecord.d.ts +129 -17
- package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbTextStyleTableRecord.js +127 -17
- package/lib/database/AcDbTextStyleTableRecord.js.map +1 -1
- package/lib/database/AcDbViewportTable.d.ts +22 -2
- package/lib/database/AcDbViewportTable.d.ts.map +1 -1
- package/lib/database/AcDbViewportTable.js +22 -2
- package/lib/database/AcDbViewportTable.js.map +1 -1
- package/lib/database/AcDbViewportTableRecord.d.ts +74 -9
- package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbViewportTableRecord.js +65 -9
- package/lib/database/AcDbViewportTableRecord.js.map +1 -1
- package/lib/entity/AcDbArc.d.ts +202 -17
- package/lib/entity/AcDbArc.d.ts.map +1 -1
- package/lib/entity/AcDbArc.js +201 -17
- package/lib/entity/AcDbArc.js.map +1 -1
- package/lib/entity/AcDbBlockReference.d.ts +147 -13
- package/lib/entity/AcDbBlockReference.d.ts.map +1 -1
- package/lib/entity/AcDbBlockReference.js +142 -13
- package/lib/entity/AcDbBlockReference.js.map +1 -1
- package/lib/entity/AcDbCircle.d.ts +145 -12
- package/lib/entity/AcDbCircle.d.ts.map +1 -1
- package/lib/entity/AcDbCircle.js +144 -12
- package/lib/entity/AcDbCircle.js.map +1 -1
- package/lib/entity/AcDbCurve.d.ts +33 -2
- package/lib/entity/AcDbCurve.d.ts.map +1 -1
- package/lib/entity/AcDbCurve.js +17 -0
- package/lib/entity/AcDbCurve.js.map +1 -1
- package/lib/entity/AcDbEllipse.d.ts +168 -16
- package/lib/entity/AcDbEllipse.d.ts.map +1 -1
- package/lib/entity/AcDbEllipse.js +167 -16
- package/lib/entity/AcDbEllipse.js.map +1 -1
- package/lib/entity/AcDbEntity.d.ts +299 -35
- package/lib/entity/AcDbEntity.d.ts.map +1 -1
- package/lib/entity/AcDbEntity.js +275 -27
- package/lib/entity/AcDbEntity.js.map +1 -1
- package/lib/entity/AcDbHatch.d.ts +60 -4
- package/lib/entity/AcDbHatch.d.ts.map +1 -1
- package/lib/entity/AcDbHatch.js +52 -4
- package/lib/entity/AcDbHatch.js.map +1 -1
- package/lib/entity/AcDbLeader.d.ts +157 -10
- package/lib/entity/AcDbLeader.d.ts.map +1 -1
- package/lib/entity/AcDbLeader.js +149 -10
- package/lib/entity/AcDbLeader.js.map +1 -1
- package/lib/entity/AcDbLine.d.ts +154 -13
- package/lib/entity/AcDbLine.d.ts.map +1 -1
- package/lib/entity/AcDbLine.js +153 -13
- package/lib/entity/AcDbLine.js.map +1 -1
- package/lib/entity/AcDbMText.d.ts +127 -11
- package/lib/entity/AcDbMText.d.ts.map +1 -1
- package/lib/entity/AcDbMText.js +112 -11
- package/lib/entity/AcDbMText.js.map +1 -1
- package/lib/entity/AcDbPoint.d.ts +86 -7
- package/lib/entity/AcDbPoint.d.ts.map +1 -1
- package/lib/entity/AcDbPoint.js +85 -7
- package/lib/entity/AcDbPoint.js.map +1 -1
- package/lib/entity/AcDbPolyline.d.ts +172 -25
- package/lib/entity/AcDbPolyline.d.ts.map +1 -1
- package/lib/entity/AcDbPolyline.js +170 -25
- package/lib/entity/AcDbPolyline.js.map +1 -1
- package/lib/entity/AcDbRasterImage.d.ts +75 -31
- package/lib/entity/AcDbRasterImage.d.ts.map +1 -1
- package/lib/entity/AcDbRasterImage.js +60 -31
- package/lib/entity/AcDbRasterImage.js.map +1 -1
- package/lib/entity/AcDbRay.d.ts +115 -9
- package/lib/entity/AcDbRay.d.ts.map +1 -1
- package/lib/entity/AcDbRay.js +113 -9
- package/lib/entity/AcDbRay.js.map +1 -1
- package/lib/entity/AcDbSpline.d.ts +106 -14
- package/lib/entity/AcDbSpline.d.ts.map +1 -1
- package/lib/entity/AcDbSpline.js +67 -4
- package/lib/entity/AcDbSpline.js.map +1 -1
- package/lib/entity/AcDbTable.d.ts +161 -44
- package/lib/entity/AcDbTable.d.ts.map +1 -1
- package/lib/entity/AcDbTable.js +135 -44
- package/lib/entity/AcDbTable.js.map +1 -1
- package/lib/entity/AcDbText.d.ts +298 -25
- package/lib/entity/AcDbText.d.ts.map +1 -1
- package/lib/entity/AcDbText.js +288 -25
- package/lib/entity/AcDbText.js.map +1 -1
- package/lib/entity/AcDbTrace.d.ts +150 -23
- package/lib/entity/AcDbTrace.d.ts.map +1 -1
- package/lib/entity/AcDbTrace.js +147 -23
- package/lib/entity/AcDbTrace.js.map +1 -1
- package/lib/entity/AcDbViewport.d.ts +122 -9
- package/lib/entity/AcDbViewport.d.ts.map +1 -1
- package/lib/entity/AcDbViewport.js +122 -9
- package/lib/entity/AcDbViewport.js.map +1 -1
- package/lib/entity/AcDbWipeout.d.ts +29 -1
- package/lib/entity/AcDbWipeout.d.ts.map +1 -1
- package/lib/entity/AcDbWipeout.js +29 -1
- package/lib/entity/AcDbWipeout.js.map +1 -1
- package/lib/entity/AcDbXline.d.ts +116 -9
- package/lib/entity/AcDbXline.d.ts.map +1 -1
- package/lib/entity/AcDbXline.js +114 -9
- package/lib/entity/AcDbXline.js.map +1 -1
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +56 -12
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDb3PointAngularDimension.js +56 -12
- package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts +158 -17
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbAlignedDimension.js +153 -17
- package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbArcDimension.d.ts +58 -12
- package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbArcDimension.js +58 -12
- package/lib/entity/dimension/AcDbArcDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts +99 -25
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbDiametricDimension.js +99 -25
- package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbDimension.d.ts +108 -14
- package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbDimension.js +99 -14
- package/lib/entity/dimension/AcDbDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +48 -16
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbOrdinateDimension.js +48 -16
- package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbRadialDimension.d.ts +167 -24
- package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbRadialDimension.js +162 -24
- package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -1
- package/lib/misc/AcDbAngleUnits.d.ts +12 -0
- package/lib/misc/AcDbAngleUnits.d.ts.map +1 -1
- package/lib/misc/AcDbAngleUnits.js +12 -0
- package/lib/misc/AcDbAngleUnits.js.map +1 -1
- package/lib/misc/AcDbConstants.d.ts +20 -0
- package/lib/misc/AcDbConstants.d.ts.map +1 -1
- package/lib/misc/AcDbConstants.js +20 -0
- package/lib/misc/AcDbConstants.js.map +1 -1
- package/lib/misc/AcDbDimArrowType.d.ts +24 -21
- package/lib/misc/AcDbDimArrowType.d.ts.map +1 -1
- package/lib/misc/AcDbDimArrowType.js +24 -21
- package/lib/misc/AcDbDimArrowType.js.map +1 -1
- package/lib/misc/AcDbObjectIterator.d.ts +42 -3
- package/lib/misc/AcDbObjectIterator.d.ts.map +1 -1
- package/lib/misc/AcDbObjectIterator.js +42 -3
- package/lib/misc/AcDbObjectIterator.js.map +1 -1
- package/lib/misc/AcDbOsnapMode.d.ts +18 -10
- package/lib/misc/AcDbOsnapMode.d.ts.map +1 -1
- package/lib/misc/AcDbOsnapMode.js +18 -10
- package/lib/misc/AcDbOsnapMode.js.map +1 -1
- package/lib/misc/AcDbRenderingCache.d.ts +107 -29
- package/lib/misc/AcDbRenderingCache.d.ts.map +1 -1
- package/lib/misc/AcDbRenderingCache.js +105 -29
- package/lib/misc/AcDbRenderingCache.js.map +1 -1
- package/lib/misc/AcDbUnitsValue.d.ts +58 -8
- package/lib/misc/AcDbUnitsValue.d.ts.map +1 -1
- package/lib/misc/AcDbUnitsValue.js +58 -8
- package/lib/misc/AcDbUnitsValue.js.map +1 -1
- package/lib/object/AcDbDictionary.d.ts +128 -30
- package/lib/object/AcDbDictionary.d.ts.map +1 -1
- package/lib/object/AcDbDictionary.js +126 -30
- package/lib/object/AcDbDictionary.js.map +1 -1
- package/lib/object/AcDbRasterImageDef.d.ts +38 -9
- package/lib/object/AcDbRasterImageDef.d.ts.map +1 -1
- package/lib/object/AcDbRasterImageDef.js +37 -9
- package/lib/object/AcDbRasterImageDef.js.map +1 -1
- package/lib/object/layout/AcDbLayout.d.ts +152 -13
- package/lib/object/layout/AcDbLayout.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayout.js +146 -13
- package/lib/object/layout/AcDbLayout.js.map +1 -1
- package/lib/object/layout/AcDbLayoutDictionary.d.ts +35 -7
- package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayoutDictionary.js +35 -7
- package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -1
- package/lib/object/layout/AcDbLayoutManager.d.ts +103 -31
- package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayoutManager.js +98 -31
- package/lib/object/layout/AcDbLayoutManager.js.map +1 -1
- package/package.json +4 -4
|
@@ -28,11 +28,44 @@ import { AcGeBox3d, AcGeEuler, AcGeMatrix3d, AcGePoint3d, AcGeQuaternion, AcGeVe
|
|
|
28
28
|
import { AcDbRenderingCache } from '../misc';
|
|
29
29
|
import { AcDbEntity } from './AcDbEntity';
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Represents a block reference entity in AutoCAD.
|
|
32
|
+
*
|
|
33
|
+
* A block reference is used to place, size, and display an instance of the collection
|
|
34
|
+
* of entities within the block table record that it references. Block references allow
|
|
35
|
+
* you to reuse complex geometry by referencing a block definition multiple times with
|
|
36
|
+
* different positions, rotations, and scales.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Create a block reference
|
|
41
|
+
* const blockRef = new AcDbBlockReference("MyBlock");
|
|
42
|
+
* blockRef.position = new AcGePoint3d(10, 20, 0);
|
|
43
|
+
* blockRef.rotation = Math.PI / 4; // 45 degrees
|
|
44
|
+
* blockRef.scaleFactors = new AcGePoint3d(2, 2, 1); // 2x scale
|
|
45
|
+
*
|
|
46
|
+
* // Access block reference properties
|
|
47
|
+
* console.log(`Block name: ${blockRef.blockTableRecord?.name}`);
|
|
48
|
+
* console.log(`Position: ${blockRef.position}`);
|
|
49
|
+
* console.log(`Rotation: ${blockRef.rotation}`);
|
|
50
|
+
* ```
|
|
33
51
|
*/
|
|
34
52
|
var AcDbBlockReference = /** @class */ (function (_super) {
|
|
35
53
|
__extends(AcDbBlockReference, _super);
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new block reference entity.
|
|
56
|
+
*
|
|
57
|
+
* This constructor initializes a block reference with the specified block name.
|
|
58
|
+
* The position is set to the origin, rotation to 0, normal to Z-axis, and scale factors to 1.
|
|
59
|
+
*
|
|
60
|
+
* @param blockName - The name of the block table record to reference
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const blockRef = new AcDbBlockReference("MyBlock");
|
|
65
|
+
* blockRef.position = new AcGePoint3d(5, 10, 0);
|
|
66
|
+
* blockRef.rotation = Math.PI / 6; // 30 degrees
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
36
69
|
function AcDbBlockReference(blockName) {
|
|
37
70
|
var _this = _super.call(this) || this;
|
|
38
71
|
_this._blockName = blockName;
|
|
@@ -44,11 +77,29 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
44
77
|
}
|
|
45
78
|
Object.defineProperty(AcDbBlockReference.prototype, "position", {
|
|
46
79
|
/**
|
|
47
|
-
* WCS position point (
|
|
80
|
+
* Gets the WCS position point (insertion point) of the block reference.
|
|
81
|
+
*
|
|
82
|
+
* @returns The position point in WCS coordinates
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const position = blockRef.position;
|
|
87
|
+
* console.log(`Block position: ${position.x}, ${position.y}, ${position.z}`);
|
|
88
|
+
* ```
|
|
48
89
|
*/
|
|
49
90
|
get: function () {
|
|
50
91
|
return this._position;
|
|
51
92
|
},
|
|
93
|
+
/**
|
|
94
|
+
* Sets the WCS position point (insertion point) of the block reference.
|
|
95
|
+
*
|
|
96
|
+
* @param value - The new position point
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* blockRef.position = new AcGePoint3d(15, 25, 0);
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
52
103
|
set: function (value) {
|
|
53
104
|
this._position.copy(value);
|
|
54
105
|
},
|
|
@@ -57,15 +108,34 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
57
108
|
});
|
|
58
109
|
Object.defineProperty(AcDbBlockReference.prototype, "rotation", {
|
|
59
110
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
111
|
+
* Gets the rotation value of the block reference.
|
|
112
|
+
*
|
|
113
|
+
* The rotation value is relative to the X axis of a coordinate system that is parallel
|
|
114
|
+
* to the OCS of the block reference, but has its origin at the position point of the
|
|
115
|
+
* block reference. The rotation axis is the Z axis of this coordinate system with
|
|
116
|
+
* positive rotations going counterclockwise when looking down the Z axis towards the origin.
|
|
117
|
+
*
|
|
118
|
+
* @returns The rotation value in radians
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const rotation = blockRef.rotation;
|
|
123
|
+
* console.log(`Rotation: ${rotation} radians (${rotation * 180 / Math.PI} degrees)`);
|
|
124
|
+
* ```
|
|
65
125
|
*/
|
|
66
126
|
get: function () {
|
|
67
127
|
return this._rotation;
|
|
68
128
|
},
|
|
129
|
+
/**
|
|
130
|
+
* Sets the rotation value of the block reference.
|
|
131
|
+
*
|
|
132
|
+
* @param value - The new rotation value in radians
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* blockRef.rotation = Math.PI / 4; // 45 degrees
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
69
139
|
set: function (value) {
|
|
70
140
|
this._rotation = value;
|
|
71
141
|
},
|
|
@@ -74,11 +144,29 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
74
144
|
});
|
|
75
145
|
Object.defineProperty(AcDbBlockReference.prototype, "scaleFactors", {
|
|
76
146
|
/**
|
|
77
|
-
*
|
|
147
|
+
* Gets the X, Y, and Z scale factors for the block reference.
|
|
148
|
+
*
|
|
149
|
+
* @returns The scale factors as a 3D point
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const scaleFactors = blockRef.scaleFactors;
|
|
154
|
+
* console.log(`Scale factors: ${scaleFactors.x}, ${scaleFactors.y}, ${scaleFactors.z}`);
|
|
155
|
+
* ```
|
|
78
156
|
*/
|
|
79
157
|
get: function () {
|
|
80
158
|
return this._scaleFactors;
|
|
81
159
|
},
|
|
160
|
+
/**
|
|
161
|
+
* Sets the X, Y, and Z scale factors for the block reference.
|
|
162
|
+
*
|
|
163
|
+
* @param value - The new scale factors
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* blockRef.scaleFactors = new AcGePoint3d(2, 1.5, 1); // 2x X scale, 1.5x Y scale
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
82
170
|
set: function (value) {
|
|
83
171
|
this._scaleFactors.copy(value);
|
|
84
172
|
},
|
|
@@ -87,11 +175,29 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
87
175
|
});
|
|
88
176
|
Object.defineProperty(AcDbBlockReference.prototype, "normal", {
|
|
89
177
|
/**
|
|
90
|
-
*
|
|
178
|
+
* Gets the normal vector of the plane containing the block reference.
|
|
179
|
+
*
|
|
180
|
+
* @returns The normal vector
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const normal = blockRef.normal;
|
|
185
|
+
* console.log(`Normal: ${normal.x}, ${normal.y}, ${normal.z}`);
|
|
186
|
+
* ```
|
|
91
187
|
*/
|
|
92
188
|
get: function () {
|
|
93
189
|
return this._normal;
|
|
94
190
|
},
|
|
191
|
+
/**
|
|
192
|
+
* Sets the normal vector of the plane containing the block reference.
|
|
193
|
+
*
|
|
194
|
+
* @param value - The new normal vector
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* blockRef.normal = new AcGeVector3d(0, 0, 1);
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
95
201
|
set: function (value) {
|
|
96
202
|
this._normal.copy(value).normalize();
|
|
97
203
|
},
|
|
@@ -100,8 +206,19 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
100
206
|
});
|
|
101
207
|
Object.defineProperty(AcDbBlockReference.prototype, "blockTableRecord", {
|
|
102
208
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
209
|
+
* Gets the block table record referenced by this block reference.
|
|
210
|
+
*
|
|
211
|
+
* The referenced block table record contains the entities that the block reference will display.
|
|
212
|
+
*
|
|
213
|
+
* @returns The block table record, or undefined if not found
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const blockRecord = blockRef.blockTableRecord;
|
|
218
|
+
* if (blockRecord) {
|
|
219
|
+
* console.log(`Block name: ${blockRecord.name}`);
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
105
222
|
*/
|
|
106
223
|
get: function () {
|
|
107
224
|
return this.database.tables.blockTable.getAt(this._blockName);
|
|
@@ -111,7 +228,19 @@ var AcDbBlockReference = /** @class */ (function (_super) {
|
|
|
111
228
|
});
|
|
112
229
|
Object.defineProperty(AcDbBlockReference.prototype, "geometricExtents", {
|
|
113
230
|
/**
|
|
114
|
-
*
|
|
231
|
+
* Gets the geometric extents (bounding box) of this block reference.
|
|
232
|
+
*
|
|
233
|
+
* This method calculates the bounding box by transforming the geometric extents
|
|
234
|
+
* of all entities in the referenced block according to the block reference's
|
|
235
|
+
* position, rotation, and scale factors.
|
|
236
|
+
*
|
|
237
|
+
* @returns The bounding box that encompasses the entire block reference
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* const extents = blockRef.geometricExtents;
|
|
242
|
+
* console.log(`Block bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
243
|
+
* ```
|
|
115
244
|
*/
|
|
116
245
|
get: function () {
|
|
117
246
|
var e_1, _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbBlockReference.js","sourceRoot":"","sources":["../../src/entity/AcDbBlockReference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACb,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC
|
|
1
|
+
{"version":3,"file":"AcDbBlockReference.js","sourceRoot":"","sources":["../../src/entity/AcDbBlockReference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACb,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAAwC,sCAAU;IAYhD;;;;;;;;;;;;;;OAcG;IACH,4BAAY,SAAiB;QAC3B,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,KAAI,CAAC,SAAS,GAAG,IAAI,WAAW,EAAE,CAAA;QAClC,KAAI,CAAC,SAAS,GAAG,GAAG,CAAA;QACpB,KAAI,CAAC,OAAO,GAAG,IAAI,YAAY,CAAC,CAAC,EA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AC;aAAM,CAAC;YACN,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAEO,mDAAsB,GAA9B;QACE,IAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;QACvC,UAAU,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC/D,OAAO,IAAI,YAAY,EAAE,CAAC,OAAO,CAC/B,IAAI,CAAC,SAAS,EACd,UAAU,EACV,IAAI,CAAC,aAAa,CACnB,CAAA;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AAlPD,CAAwC,UAAU,GAkPjD"}
|
|
@@ -2,49 +2,182 @@ import { AcGeMatrix3d, AcGePoint3d, AcGePoint3dLike, AcGePointLike, AcGeVector3d
|
|
|
2
2
|
import { AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
3
|
import { AcDbCurve } from './AcDbCurve';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Represents a circle entity in AutoCAD.
|
|
6
|
+
*
|
|
7
|
+
* A circle is a 2D geometric object defined by its center point and radius.
|
|
8
|
+
* Circles are closed curves that can be used to create circular shapes
|
|
9
|
+
* in drawings. The circle is always drawn in the plane defined by its normal vector.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Create a circle with center at (0,0,0) and radius 5
|
|
14
|
+
* const circle = new AcDbCircle(
|
|
15
|
+
* new AcGePoint3d(0, 0, 0),
|
|
16
|
+
* 5
|
|
17
|
+
* );
|
|
18
|
+
*
|
|
19
|
+
* // Access circle properties
|
|
20
|
+
* console.log(`Center: ${circle.center}`);
|
|
21
|
+
* console.log(`Radius: ${circle.radius}`);
|
|
22
|
+
* console.log(`Normal: ${circle.normal}`);
|
|
23
|
+
* ```
|
|
6
24
|
*/
|
|
7
25
|
export declare class AcDbCircle extends AcDbCurve {
|
|
26
|
+
/** The underlying geometric circular arc object */
|
|
8
27
|
private _geo;
|
|
9
28
|
/**
|
|
10
|
-
*
|
|
29
|
+
* Creates a new circle entity.
|
|
11
30
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
31
|
+
* This constructor creates a circle using the specified center point and radius.
|
|
32
|
+
* The center point must be in World Coordinate System (WCS) coordinates.
|
|
33
|
+
* The circle is created as a full circle (0 to 2π radians).
|
|
34
|
+
*
|
|
35
|
+
* @param center - The center point of the circle in WCS coordinates
|
|
36
|
+
* @param radius - The radius of the circle (must be positive)
|
|
37
|
+
* @param normal - The normal vector defining the plane of the circle (defaults to Z-axis)
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Create a circle in the XY plane
|
|
42
|
+
* const circle = new AcDbCircle(
|
|
43
|
+
* new AcGePoint3d(10, 20, 0),
|
|
44
|
+
* 15
|
|
45
|
+
* );
|
|
46
|
+
*
|
|
47
|
+
* // Create a circle in a different plane
|
|
48
|
+
* const circleInYZ = new AcDbCircle(
|
|
49
|
+
* new AcGePoint3d(0, 0, 0),
|
|
50
|
+
* 10,
|
|
51
|
+
* AcGeVector3d.X_AXIS
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
14
54
|
*/
|
|
15
55
|
constructor(center: AcGePointLike, radius: number, normal?: AcGeVector3d);
|
|
16
56
|
/**
|
|
17
|
-
*
|
|
57
|
+
* Gets the center point of this circle.
|
|
58
|
+
*
|
|
59
|
+
* @returns The center point as a 3D point
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const centerPoint = circle.center;
|
|
64
|
+
* console.log(`Circle center: ${centerPoint.x}, ${centerPoint.y}, ${centerPoint.z}`);
|
|
65
|
+
* ```
|
|
18
66
|
*/
|
|
19
67
|
get center(): AcGePoint3d;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the center point of this circle.
|
|
70
|
+
*
|
|
71
|
+
* @param value - The new center point
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* circle.center = new AcGePoint3d(5, 5, 0);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
20
78
|
set center(value: AcGePoint3dLike);
|
|
21
79
|
/**
|
|
22
|
-
*
|
|
80
|
+
* Gets the radius of this circle.
|
|
81
|
+
*
|
|
82
|
+
* @returns The radius value
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const radius = circle.radius;
|
|
87
|
+
* console.log(`Circle radius: ${radius}`);
|
|
88
|
+
* ```
|
|
23
89
|
*/
|
|
24
90
|
get radius(): number;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the radius of this circle.
|
|
93
|
+
*
|
|
94
|
+
* @param value - The new radius value (must be positive)
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* circle.radius = 25;
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
25
101
|
set radius(value: number);
|
|
26
102
|
/**
|
|
27
|
-
*
|
|
103
|
+
* Gets the normal vector of this circle.
|
|
104
|
+
*
|
|
105
|
+
* The normal vector defines the plane in which the circle lies.
|
|
106
|
+
*
|
|
107
|
+
* @returns The unit normal vector in WCS coordinates
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const normal = circle.normal;
|
|
112
|
+
* console.log(`Circle normal: ${normal.x}, ${normal.y}, ${normal.z}`);
|
|
113
|
+
* ```
|
|
28
114
|
*/
|
|
29
115
|
get normal(): AcGeVector3d;
|
|
30
116
|
/**
|
|
31
|
-
*
|
|
117
|
+
* Gets the geometric extents (bounding box) of this circle.
|
|
118
|
+
*
|
|
119
|
+
* @returns The bounding box that encompasses the entire circle
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* const extents = circle.geometricExtents;
|
|
124
|
+
* console.log(`Circle bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
125
|
+
* ```
|
|
32
126
|
*/
|
|
33
127
|
get geometricExtents(): import("@mlightcad/geometry-engine").AcGeBox3d;
|
|
34
128
|
/**
|
|
35
|
-
*
|
|
129
|
+
* Gets whether this circle is closed.
|
|
130
|
+
*
|
|
131
|
+
* Circles are always closed entities, so this always returns true.
|
|
132
|
+
*
|
|
133
|
+
* @returns Always true for circles
|
|
36
134
|
*/
|
|
37
135
|
get closed(): boolean;
|
|
38
136
|
/**
|
|
39
|
-
*
|
|
137
|
+
* Gets the grip points for this circle.
|
|
138
|
+
*
|
|
139
|
+
* Grip points are control points that can be used to modify the circle.
|
|
140
|
+
* For a circle, the grip point is the center point.
|
|
141
|
+
*
|
|
142
|
+
* @returns Array of grip points (center point)
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const gripPoints = circle.subGetGripPoints();
|
|
147
|
+
* // gripPoints contains: [center]
|
|
148
|
+
* ```
|
|
40
149
|
*/
|
|
41
150
|
subGetGripPoints(): AcGePoint3d[];
|
|
42
151
|
/**
|
|
43
|
-
*
|
|
152
|
+
* Transforms this circle by the specified matrix.
|
|
153
|
+
*
|
|
154
|
+
* This method applies a geometric transformation to the circle, updating
|
|
155
|
+
* the center point, radius, and normal vector according to the transformation matrix.
|
|
156
|
+
*
|
|
157
|
+
* @param matrix - The transformation matrix to apply
|
|
158
|
+
* @returns This circle after transformation
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* const translationMatrix = AcGeMatrix3d.translation(10, 0, 0);
|
|
163
|
+
* circle.transformBy(translationMatrix);
|
|
164
|
+
* // Circle is now translated 10 units in the X direction
|
|
165
|
+
* ```
|
|
44
166
|
*/
|
|
45
167
|
transformBy(matrix: AcGeMatrix3d): this;
|
|
46
168
|
/**
|
|
47
|
-
*
|
|
169
|
+
* Draws this circle using the specified renderer.
|
|
170
|
+
*
|
|
171
|
+
* This method renders the circle as a circular arc using the circle's
|
|
172
|
+
* current style properties.
|
|
173
|
+
*
|
|
174
|
+
* @param renderer - The renderer to use for drawing
|
|
175
|
+
* @returns The rendered circle entity, or undefined if drawing failed
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const renderedCircle = circle.draw(renderer);
|
|
180
|
+
* ```
|
|
48
181
|
*/
|
|
49
182
|
draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
|
|
50
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbCircle.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,YAAY,EAEb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"AcDbCircle.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,YAAY,EAEb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,mDAAmD;IACnD,OAAO,CAAC,IAAI,CAAe;IAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;gBAED,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,YAAkC;IAa5C;;;;;;;;;;OAUG;IACH,IAAI,MAAM,IAAI,WAAW,CAExB;IAED;;;;;;;;;OASG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,eAAe,EAEhC;IAED;;;;;;;;;;OAUG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;;;OASG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,MAAM,iBAET;IAED;;;;;;;;;;OAUG;IACH,IAAI,gBAAgB,mDAEnB;IAED;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB;IAMhB;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,MAAM,EAAE,YAAY;IAKhC;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAG5B"}
|
package/lib/entity/AcDbCircle.js
CHANGED
|
@@ -16,15 +16,54 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
import { AcGeCircArc3d, AcGeVector3d, TAU } from '@mlightcad/geometry-engine';
|
|
17
17
|
import { AcDbCurve } from './AcDbCurve';
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Represents a circle entity in AutoCAD.
|
|
20
|
+
*
|
|
21
|
+
* A circle is a 2D geometric object defined by its center point and radius.
|
|
22
|
+
* Circles are closed curves that can be used to create circular shapes
|
|
23
|
+
* in drawings. The circle is always drawn in the plane defined by its normal vector.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Create a circle with center at (0,0,0) and radius 5
|
|
28
|
+
* const circle = new AcDbCircle(
|
|
29
|
+
* new AcGePoint3d(0, 0, 0),
|
|
30
|
+
* 5
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
* // Access circle properties
|
|
34
|
+
* console.log(`Center: ${circle.center}`);
|
|
35
|
+
* console.log(`Radius: ${circle.radius}`);
|
|
36
|
+
* console.log(`Normal: ${circle.normal}`);
|
|
37
|
+
* ```
|
|
20
38
|
*/
|
|
21
39
|
var AcDbCircle = /** @class */ (function (_super) {
|
|
22
40
|
__extends(AcDbCircle, _super);
|
|
23
41
|
/**
|
|
24
|
-
*
|
|
42
|
+
* Creates a new circle entity.
|
|
25
43
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
44
|
+
* This constructor creates a circle using the specified center point and radius.
|
|
45
|
+
* The center point must be in World Coordinate System (WCS) coordinates.
|
|
46
|
+
* The circle is created as a full circle (0 to 2π radians).
|
|
47
|
+
*
|
|
48
|
+
* @param center - The center point of the circle in WCS coordinates
|
|
49
|
+
* @param radius - The radius of the circle (must be positive)
|
|
50
|
+
* @param normal - The normal vector defining the plane of the circle (defaults to Z-axis)
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // Create a circle in the XY plane
|
|
55
|
+
* const circle = new AcDbCircle(
|
|
56
|
+
* new AcGePoint3d(10, 20, 0),
|
|
57
|
+
* 15
|
|
58
|
+
* );
|
|
59
|
+
*
|
|
60
|
+
* // Create a circle in a different plane
|
|
61
|
+
* const circleInYZ = new AcDbCircle(
|
|
62
|
+
* new AcGePoint3d(0, 0, 0),
|
|
63
|
+
* 10,
|
|
64
|
+
* AcGeVector3d.X_AXIS
|
|
65
|
+
* );
|
|
66
|
+
* ```
|
|
28
67
|
*/
|
|
29
68
|
function AcDbCircle(center, radius, normal) {
|
|
30
69
|
if (normal === void 0) { normal = AcGeVector3d.Z_AXIS; }
|
|
@@ -34,11 +73,29 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
34
73
|
}
|
|
35
74
|
Object.defineProperty(AcDbCircle.prototype, "center", {
|
|
36
75
|
/**
|
|
37
|
-
*
|
|
76
|
+
* Gets the center point of this circle.
|
|
77
|
+
*
|
|
78
|
+
* @returns The center point as a 3D point
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const centerPoint = circle.center;
|
|
83
|
+
* console.log(`Circle center: ${centerPoint.x}, ${centerPoint.y}, ${centerPoint.z}`);
|
|
84
|
+
* ```
|
|
38
85
|
*/
|
|
39
86
|
get: function () {
|
|
40
87
|
return this._geo.center;
|
|
41
88
|
},
|
|
89
|
+
/**
|
|
90
|
+
* Sets the center point of this circle.
|
|
91
|
+
*
|
|
92
|
+
* @param value - The new center point
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* circle.center = new AcGePoint3d(5, 5, 0);
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
42
99
|
set: function (value) {
|
|
43
100
|
this._geo.center = value;
|
|
44
101
|
},
|
|
@@ -47,11 +104,29 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
47
104
|
});
|
|
48
105
|
Object.defineProperty(AcDbCircle.prototype, "radius", {
|
|
49
106
|
/**
|
|
50
|
-
*
|
|
107
|
+
* Gets the radius of this circle.
|
|
108
|
+
*
|
|
109
|
+
* @returns The radius value
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const radius = circle.radius;
|
|
114
|
+
* console.log(`Circle radius: ${radius}`);
|
|
115
|
+
* ```
|
|
51
116
|
*/
|
|
52
117
|
get: function () {
|
|
53
118
|
return this._geo.radius;
|
|
54
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* Sets the radius of this circle.
|
|
122
|
+
*
|
|
123
|
+
* @param value - The new radius value (must be positive)
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* circle.radius = 25;
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
55
130
|
set: function (value) {
|
|
56
131
|
this._geo.radius = value;
|
|
57
132
|
},
|
|
@@ -60,7 +135,17 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
60
135
|
});
|
|
61
136
|
Object.defineProperty(AcDbCircle.prototype, "normal", {
|
|
62
137
|
/**
|
|
63
|
-
*
|
|
138
|
+
* Gets the normal vector of this circle.
|
|
139
|
+
*
|
|
140
|
+
* The normal vector defines the plane in which the circle lies.
|
|
141
|
+
*
|
|
142
|
+
* @returns The unit normal vector in WCS coordinates
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const normal = circle.normal;
|
|
147
|
+
* console.log(`Circle normal: ${normal.x}, ${normal.y}, ${normal.z}`);
|
|
148
|
+
* ```
|
|
64
149
|
*/
|
|
65
150
|
get: function () {
|
|
66
151
|
return this._geo.normal;
|
|
@@ -70,7 +155,15 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
70
155
|
});
|
|
71
156
|
Object.defineProperty(AcDbCircle.prototype, "geometricExtents", {
|
|
72
157
|
/**
|
|
73
|
-
*
|
|
158
|
+
* Gets the geometric extents (bounding box) of this circle.
|
|
159
|
+
*
|
|
160
|
+
* @returns The bounding box that encompasses the entire circle
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const extents = circle.geometricExtents;
|
|
165
|
+
* console.log(`Circle bounds: ${extents.minPoint} to ${extents.maxPoint}`);
|
|
166
|
+
* ```
|
|
74
167
|
*/
|
|
75
168
|
get: function () {
|
|
76
169
|
return this._geo.box;
|
|
@@ -80,7 +173,11 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
80
173
|
});
|
|
81
174
|
Object.defineProperty(AcDbCircle.prototype, "closed", {
|
|
82
175
|
/**
|
|
83
|
-
*
|
|
176
|
+
* Gets whether this circle is closed.
|
|
177
|
+
*
|
|
178
|
+
* Circles are always closed entities, so this always returns true.
|
|
179
|
+
*
|
|
180
|
+
* @returns Always true for circles
|
|
84
181
|
*/
|
|
85
182
|
get: function () {
|
|
86
183
|
return this._geo.closed;
|
|
@@ -89,7 +186,18 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
89
186
|
configurable: true
|
|
90
187
|
});
|
|
91
188
|
/**
|
|
92
|
-
*
|
|
189
|
+
* Gets the grip points for this circle.
|
|
190
|
+
*
|
|
191
|
+
* Grip points are control points that can be used to modify the circle.
|
|
192
|
+
* For a circle, the grip point is the center point.
|
|
193
|
+
*
|
|
194
|
+
* @returns Array of grip points (center point)
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const gripPoints = circle.subGetGripPoints();
|
|
199
|
+
* // gripPoints contains: [center]
|
|
200
|
+
* ```
|
|
93
201
|
*/
|
|
94
202
|
AcDbCircle.prototype.subGetGripPoints = function () {
|
|
95
203
|
var gripPoints = new Array();
|
|
@@ -97,14 +205,38 @@ var AcDbCircle = /** @class */ (function (_super) {
|
|
|
97
205
|
return gripPoints;
|
|
98
206
|
};
|
|
99
207
|
/**
|
|
100
|
-
*
|
|
208
|
+
* Transforms this circle by the specified matrix.
|
|
209
|
+
*
|
|
210
|
+
* This method applies a geometric transformation to the circle, updating
|
|
211
|
+
* the center point, radius, and normal vector according to the transformation matrix.
|
|
212
|
+
*
|
|
213
|
+
* @param matrix - The transformation matrix to apply
|
|
214
|
+
* @returns This circle after transformation
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* const translationMatrix = AcGeMatrix3d.translation(10, 0, 0);
|
|
219
|
+
* circle.transformBy(translationMatrix);
|
|
220
|
+
* // Circle is now translated 10 units in the X direction
|
|
221
|
+
* ```
|
|
101
222
|
*/
|
|
102
223
|
AcDbCircle.prototype.transformBy = function (matrix) {
|
|
103
224
|
this._geo.transform(matrix);
|
|
104
225
|
return this;
|
|
105
226
|
};
|
|
106
227
|
/**
|
|
107
|
-
*
|
|
228
|
+
* Draws this circle using the specified renderer.
|
|
229
|
+
*
|
|
230
|
+
* This method renders the circle as a circular arc using the circle's
|
|
231
|
+
* current style properties.
|
|
232
|
+
*
|
|
233
|
+
* @param renderer - The renderer to use for drawing
|
|
234
|
+
* @returns The rendered circle entity, or undefined if drawing failed
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* const renderedCircle = circle.draw(renderer);
|
|
239
|
+
* ```
|
|
108
240
|
*/
|
|
109
241
|
AcDbCircle.prototype.draw = function (renderer) {
|
|
110
242
|
return renderer.circularArc(this._geo, this.lineStyle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbCircle.js","sourceRoot":"","sources":["../../src/entity/AcDbCircle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,aAAa,EAKb,YAAY,EACZ,GAAG,EACJ,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"AcDbCircle.js","sourceRoot":"","sources":["../../src/entity/AcDbCircle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,aAAa,EAKb,YAAY,EACZ,GAAG,EACJ,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAgC,8BAAS;IAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,oBACE,MAAqB,EACrB,MAAc,EACd,MAA0C;QAA1C,uBAAA,EAAA,SAAuB,YAAY,CAAC,MAAM;QAE1C,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAC3B,MAAM,EACN,MAAM,EACN,CAAC,EACD,GAAG,EACH,MAAM,EACN,YAAY,CAAC,MAAM,CACpB,CAAA;;IACH,CAAC;IAaD,sBAAI,8BAAM;QAXV;;;;;;;;;;WAUG;aACH;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;QACzB,CAAC;QAED;;;;;;;;;WASG;aACH,UAAW,KAAsB;YAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QA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