@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
package/lib/entity/AcDbEntity.js
CHANGED
|
@@ -52,20 +52,62 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
52
52
|
import { AcCmColor } from '@mlightcad/common';
|
|
53
53
|
import { AcDbObject } from '../base/AcDbObject';
|
|
54
54
|
import { ByBlock, ByLayer, DEFAULT_LINE_TYPE } from '../misc';
|
|
55
|
+
/**
|
|
56
|
+
* Abstract base class for all drawing entities.
|
|
57
|
+
*
|
|
58
|
+
* This class provides the fundamental functionality for all drawing entities,
|
|
59
|
+
* including layer management, color handling, linetype support, visibility,
|
|
60
|
+
* and geometric operations. All specific entity types (lines, circles, text, etc.)
|
|
61
|
+
* inherit from this class.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* class MyEntity extends AcDbEntity {
|
|
66
|
+
* get geometricExtents(): AcGeBox3d {
|
|
67
|
+
* // Implementation for geometric extents
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* draw(renderer: AcGiRenderer): AcGiEntity | undefined {
|
|
71
|
+
* // Implementation for drawing
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
55
76
|
var AcDbEntity = /** @class */ (function (_super) {
|
|
56
77
|
__extends(AcDbEntity, _super);
|
|
57
78
|
function AcDbEntity() {
|
|
58
79
|
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
80
|
+
/** The layer name this entity belongs to */
|
|
59
81
|
_this._layer = '0';
|
|
82
|
+
/** The color of this entity */
|
|
60
83
|
_this._color = new AcCmColor();
|
|
84
|
+
/** The linetype name for this entity */
|
|
61
85
|
_this._lineType = ByLayer;
|
|
86
|
+
/** The line weight for this entity */
|
|
62
87
|
_this._lineWeight = 1;
|
|
88
|
+
/** The linetype scale factor for this entity */
|
|
63
89
|
_this._linetypeScale = -1;
|
|
90
|
+
/** Whether this entity is visible */
|
|
64
91
|
_this._visibility = true;
|
|
92
|
+
/** The transparency level of this entity (0-1) */
|
|
65
93
|
_this._transparency = 0;
|
|
66
94
|
return _this;
|
|
67
95
|
}
|
|
68
96
|
Object.defineProperty(AcDbEntity.prototype, "type", {
|
|
97
|
+
/**
|
|
98
|
+
* Gets the type name of this entity.
|
|
99
|
+
*
|
|
100
|
+
* This method returns the entity type by removing the "AcDb" prefix
|
|
101
|
+
* from the constructor name.
|
|
102
|
+
*
|
|
103
|
+
* @returns The entity type name
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* const entity = new AcDbLine();
|
|
108
|
+
* console.log(entity.type); // "Line"
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
69
111
|
get: function () {
|
|
70
112
|
return this.constructor.name.substring(4);
|
|
71
113
|
},
|
|
@@ -74,11 +116,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
74
116
|
});
|
|
75
117
|
Object.defineProperty(AcDbEntity.prototype, "layer", {
|
|
76
118
|
/**
|
|
77
|
-
*
|
|
119
|
+
* Gets the name of the layer referenced by this entity.
|
|
120
|
+
*
|
|
121
|
+
* @returns The layer name
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const layerName = entity.layer;
|
|
126
|
+
* ```
|
|
78
127
|
*/
|
|
79
128
|
get: function () {
|
|
80
129
|
return this._layer;
|
|
81
130
|
},
|
|
131
|
+
/**
|
|
132
|
+
* Sets the name of the layer for this entity.
|
|
133
|
+
*
|
|
134
|
+
* @param value - The new layer name
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* entity.layer = 'MyLayer';
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
82
141
|
set: function (value) {
|
|
83
142
|
this._layer = value;
|
|
84
143
|
},
|
|
@@ -87,11 +146,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
87
146
|
});
|
|
88
147
|
Object.defineProperty(AcDbEntity.prototype, "color", {
|
|
89
148
|
/**
|
|
90
|
-
*
|
|
149
|
+
* Gets the color information of this entity.
|
|
150
|
+
*
|
|
151
|
+
* @returns The color object for this entity
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const color = entity.color;
|
|
156
|
+
* ```
|
|
91
157
|
*/
|
|
92
158
|
get: function () {
|
|
93
159
|
return this._color;
|
|
94
160
|
},
|
|
161
|
+
/**
|
|
162
|
+
* Sets the color information for this entity.
|
|
163
|
+
*
|
|
164
|
+
* @param value - The new color object
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* entity.color = new AcCmColor(0xFF0000);
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
95
171
|
set: function (value) {
|
|
96
172
|
this._color.copy(value);
|
|
97
173
|
},
|
|
@@ -100,8 +176,18 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
100
176
|
});
|
|
101
177
|
Object.defineProperty(AcDbEntity.prototype, "rgbColor", {
|
|
102
178
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
179
|
+
* Gets the RGB color of this entity after converting color index.
|
|
180
|
+
*
|
|
181
|
+
* This method handles the conversion of color indices (including ByLayer and ByBlock)
|
|
182
|
+
* to actual RGB colors. It resolves layer colors and block colors as needed.
|
|
183
|
+
*
|
|
184
|
+
* @returns The RGB color value as a number
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* const rgbColor = entity.rgbColor;
|
|
189
|
+
* console.log(`RGB: ${rgbColor.toString(16)}`);
|
|
190
|
+
* ```
|
|
105
191
|
*/
|
|
106
192
|
get: function () {
|
|
107
193
|
// Default color
|
|
@@ -126,11 +212,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
126
212
|
});
|
|
127
213
|
Object.defineProperty(AcDbEntity.prototype, "lineType", {
|
|
128
214
|
/**
|
|
129
|
-
*
|
|
215
|
+
* Gets the name of the line type referenced by this entity.
|
|
216
|
+
*
|
|
217
|
+
* @returns The linetype name
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const lineType = entity.lineType;
|
|
222
|
+
* ```
|
|
130
223
|
*/
|
|
131
224
|
get: function () {
|
|
132
225
|
return this._lineType;
|
|
133
226
|
},
|
|
227
|
+
/**
|
|
228
|
+
* Sets the name of the line type for this entity.
|
|
229
|
+
*
|
|
230
|
+
* @param value - The new linetype name
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* entity.lineType = 'DASHED';
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
134
237
|
set: function (value) {
|
|
135
238
|
this._lineType = value || ByLayer;
|
|
136
239
|
},
|
|
@@ -139,11 +242,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
139
242
|
});
|
|
140
243
|
Object.defineProperty(AcDbEntity.prototype, "lineWeight", {
|
|
141
244
|
/**
|
|
142
|
-
*
|
|
245
|
+
* Gets the line weight used by this entity.
|
|
246
|
+
*
|
|
247
|
+
* @returns The line weight value
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* const weight = entity.lineWeight;
|
|
252
|
+
* ```
|
|
143
253
|
*/
|
|
144
254
|
get: function () {
|
|
145
255
|
return this._lineWeight;
|
|
146
256
|
},
|
|
257
|
+
/**
|
|
258
|
+
* Sets the line weight for this entity.
|
|
259
|
+
*
|
|
260
|
+
* @param value - The new line weight value
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```typescript
|
|
264
|
+
* entity.lineWeight = 2;
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
147
267
|
set: function (value) {
|
|
148
268
|
this._lineWeight = value;
|
|
149
269
|
},
|
|
@@ -152,13 +272,33 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
152
272
|
});
|
|
153
273
|
Object.defineProperty(AcDbEntity.prototype, "linetypeScale", {
|
|
154
274
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
275
|
+
* Gets the line type scale factor of this entity.
|
|
276
|
+
*
|
|
277
|
+
* When an entity is first instantiated, its line type scale is initialized
|
|
278
|
+
* to an invalid value. When the entity is added to the database, if a
|
|
279
|
+
* linetype scale has not been specified for the entity, it is set to the
|
|
280
|
+
* database's current line type scale value.
|
|
281
|
+
*
|
|
282
|
+
* @returns The linetype scale factor
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```typescript
|
|
286
|
+
* const scale = entity.linetypeScale;
|
|
287
|
+
* ```
|
|
158
288
|
*/
|
|
159
289
|
get: function () {
|
|
160
290
|
return this._linetypeScale;
|
|
161
291
|
},
|
|
292
|
+
/**
|
|
293
|
+
* Sets the line type scale factor for this entity.
|
|
294
|
+
*
|
|
295
|
+
* @param value - The new linetype scale factor
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* entity.linetypeScale = 2.0;
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
162
302
|
set: function (value) {
|
|
163
303
|
this._linetypeScale = value;
|
|
164
304
|
},
|
|
@@ -167,11 +307,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
167
307
|
});
|
|
168
308
|
Object.defineProperty(AcDbEntity.prototype, "visibility", {
|
|
169
309
|
/**
|
|
170
|
-
*
|
|
310
|
+
* Gets whether this entity is visible.
|
|
311
|
+
*
|
|
312
|
+
* @returns True if the entity is visible, false otherwise
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const isVisible = entity.visibility;
|
|
317
|
+
* ```
|
|
171
318
|
*/
|
|
172
319
|
get: function () {
|
|
173
320
|
return this._visibility;
|
|
174
321
|
},
|
|
322
|
+
/**
|
|
323
|
+
* Sets whether this entity is visible.
|
|
324
|
+
*
|
|
325
|
+
* @param value - True to make the entity visible, false to hide it
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* entity.visibility = false; // Hide the entity
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
175
332
|
set: function (value) {
|
|
176
333
|
this._visibility = value;
|
|
177
334
|
},
|
|
@@ -180,11 +337,28 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
180
337
|
});
|
|
181
338
|
Object.defineProperty(AcDbEntity.prototype, "transparency", {
|
|
182
339
|
/**
|
|
183
|
-
*
|
|
340
|
+
* Gets the transparency level of this entity.
|
|
341
|
+
*
|
|
342
|
+
* @returns The transparency value (0-1, where 0 is opaque and 1 is fully transparent)
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* const transparency = entity.transparency;
|
|
347
|
+
* ```
|
|
184
348
|
*/
|
|
185
349
|
get: function () {
|
|
186
350
|
return this._transparency;
|
|
187
351
|
},
|
|
352
|
+
/**
|
|
353
|
+
* Sets the transparency level of this entity.
|
|
354
|
+
*
|
|
355
|
+
* @param value - The transparency value (0-1, where 0 is opaque and 1 is fully transparent)
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```typescript
|
|
359
|
+
* entity.transparency = 0.5; // 50% transparent
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
188
362
|
set: function (value) {
|
|
189
363
|
this._transparency = value;
|
|
190
364
|
},
|
|
@@ -192,24 +366,41 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
192
366
|
configurable: true
|
|
193
367
|
});
|
|
194
368
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
369
|
+
* Gets the grip points for this entity.
|
|
370
|
+
*
|
|
371
|
+
* Grip points are the control points that can be used to modify the entity.
|
|
372
|
+
* This method should be overridden by subclasses to provide entity-specific
|
|
373
|
+
* grip points.
|
|
374
|
+
*
|
|
375
|
+
* @returns Array of grip points as 3D points
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```typescript
|
|
379
|
+
* const gripPoints = entity.subGetGripPoints();
|
|
380
|
+
* ```
|
|
197
381
|
*/
|
|
198
382
|
AcDbEntity.prototype.subGetGripPoints = function () {
|
|
199
383
|
var gripPoints = new Array();
|
|
200
384
|
return gripPoints;
|
|
201
385
|
};
|
|
202
386
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* points
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* @param
|
|
210
|
-
* @param
|
|
211
|
-
*
|
|
212
|
-
*
|
|
387
|
+
* Gets the object snap points for this entity.
|
|
388
|
+
*
|
|
389
|
+
* Object snap points are the points that can be used for precise positioning
|
|
390
|
+
* when drawing or editing. This method should be overridden by subclasses
|
|
391
|
+
* to provide entity-specific snap points.
|
|
392
|
+
*
|
|
393
|
+
* @param osnapMode - The object snap mode
|
|
394
|
+
* @param gsSelectionMark - The selection mark
|
|
395
|
+
* @param pickPoint - The pick point
|
|
396
|
+
* @param lastPoint - The last point
|
|
397
|
+
* @param snapPoints - Array to populate with snap points
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const snapPoints: AcGePoint3d[] = [];
|
|
402
|
+
* entity.subGetOsnapPoints(AcDbOsnapMode.Endpoint, 0, pickPoint, lastPoint, snapPoints);
|
|
403
|
+
* ```
|
|
213
404
|
*/
|
|
214
405
|
AcDbEntity.prototype.subGetOsnapPoints = function (
|
|
215
406
|
// @ts-expect-error not use '_' prefix so that typedoc can the correct parameter to generate doc
|
|
@@ -223,16 +414,34 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
223
414
|
// @ts-expect-error not use '_' prefix so that typedoc can the correct parameter to generate doc
|
|
224
415
|
snapPoints) { };
|
|
225
416
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
417
|
+
* Transforms this entity by the specified matrix.
|
|
418
|
+
*
|
|
419
|
+
* This method applies a geometric transformation to the entity.
|
|
420
|
+
* Subclasses should override this method to provide entity-specific
|
|
421
|
+
* transformation behavior.
|
|
422
|
+
*
|
|
423
|
+
* @param matrix - The transformation matrix to apply
|
|
424
|
+
* @returns This entity after transformation
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```typescript
|
|
428
|
+
* const matrix = AcGeMatrix3d.translation(10, 0, 0);
|
|
429
|
+
* entity.transformBy(matrix);
|
|
430
|
+
* ```
|
|
229
431
|
*/
|
|
230
432
|
// @ts-expect-error not use '_' prefix so that typedoc can the correct parameter to generate doc
|
|
231
433
|
AcDbEntity.prototype.transformBy = function (matrix) {
|
|
232
434
|
return this;
|
|
233
435
|
};
|
|
234
436
|
/**
|
|
235
|
-
*
|
|
437
|
+
* Triggers a modified event for this entity.
|
|
438
|
+
*
|
|
439
|
+
* This method notifies listeners that the entity has been modified.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```typescript
|
|
443
|
+
* entity.triggerModifiedEvent();
|
|
444
|
+
* ```
|
|
236
445
|
*/
|
|
237
446
|
AcDbEntity.prototype.triggerModifiedEvent = function () {
|
|
238
447
|
this.database.events.entityModified.dispatch({
|
|
@@ -241,6 +450,19 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
241
450
|
});
|
|
242
451
|
};
|
|
243
452
|
Object.defineProperty(AcDbEntity.prototype, "lineStyle", {
|
|
453
|
+
/**
|
|
454
|
+
* Gets the line style for this entity.
|
|
455
|
+
*
|
|
456
|
+
* This method returns the line style based on the entity's linetype
|
|
457
|
+
* and other properties.
|
|
458
|
+
*
|
|
459
|
+
* @returns The line style object
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```typescript
|
|
463
|
+
* const lineStyle = entity.lineStyle;
|
|
464
|
+
* ```
|
|
465
|
+
*/
|
|
244
466
|
get: function () {
|
|
245
467
|
var _a;
|
|
246
468
|
var linetypeName = this.getLineType();
|
|
@@ -261,6 +483,19 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
261
483
|
enumerable: false,
|
|
262
484
|
configurable: true
|
|
263
485
|
});
|
|
486
|
+
/**
|
|
487
|
+
* Gets the line type for this entity.
|
|
488
|
+
*
|
|
489
|
+
* This method resolves the line type, handling ByLayer and ByBlock
|
|
490
|
+
* references as needed.
|
|
491
|
+
*
|
|
492
|
+
* @returns The resolved line type name
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* ```typescript
|
|
496
|
+
* const lineType = entity.getLineType();
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
264
499
|
AcDbEntity.prototype.getLineType = function () {
|
|
265
500
|
if (this.lineType == ByLayer) {
|
|
266
501
|
var layer = this.database.tables.layerTable.getAt(this.layer);
|
|
@@ -276,6 +511,19 @@ var AcDbEntity = /** @class */ (function (_super) {
|
|
|
276
511
|
}
|
|
277
512
|
return DEFAULT_LINE_TYPE;
|
|
278
513
|
};
|
|
514
|
+
/**
|
|
515
|
+
* Gets the color of the layer this entity belongs to.
|
|
516
|
+
*
|
|
517
|
+
* This method retrieves the color from the layer table for the
|
|
518
|
+
* layer this entity belongs to.
|
|
519
|
+
*
|
|
520
|
+
* @returns The layer color, or undefined if the layer doesn't exist
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* const layerColor = entity.getLayerColor();
|
|
525
|
+
* ```
|
|
526
|
+
*/
|
|
279
527
|
AcDbEntity.prototype.getLayerColor = function () {
|
|
280
528
|
var layer = this.database.tables.layerTable.getAt(this.layer);
|
|
281
529
|
if (layer == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbEntity.js","sourceRoot":"","sources":["../../src/entity/AcDbEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAY7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAiB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE5E;IAAyC,8BAAU;IAAnD;;
|
|
1
|
+
{"version":3,"file":"AcDbEntity.js","sourceRoot":"","sources":["../../src/entity/AcDbEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAY7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAiB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAyC,8BAAU;IAAnD;;QACE,4CAA4C;QACpC,YAAM,GAAW,GAAG,CAAA;QAC5B,+BAA+B;QACvB,YAAM,GAAc,IAAI,SAAS,EAAE,CAAA;QAC3C,wCAAwC;QAChC,eAAS,GAAW,OAAO,CAAA;QACnC,sC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IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC/D,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ;gBAAE,OAAO,KAAK,CAAC,QAAQ,CAAA;QACpD,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,EAAE,CAAC;YACpC,gCAAgC;YAChC,OAAO,iBAAiB,CAAA;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,QAAQ,CAAA;QACtB,CAAC;QACH,OAAO,iBAAiB,CAAA;IACxB,CAAC;IAED;;;;;;;;;;;;OAYG;IACO,kCAAa,GAAvB;QACE,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC/D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CACX,+BAAwB,IAAI,CAAC,KAAK,qCAAkC,CACrE,CAAA;QACH,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC,KAAK,CAAA;QACpB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IACH,iBAAC;AAAD,CAAC,AAndD,CAAyC,UAAU,GAmdlD"}
|
|
@@ -2,7 +2,7 @@ import { AcGeBox3d, AcGeLoop2dType } from '@mlightcad/geometry-engine';
|
|
|
2
2
|
import { AcGiHatchPatternLine, AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
3
|
import { AcDbEntity } from './AcDbEntity';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Defines the type of hatch pattern.
|
|
6
6
|
*/
|
|
7
7
|
export declare enum AcDbHatchPatternType {
|
|
8
8
|
/**
|
|
@@ -35,7 +35,7 @@ export declare enum AcDbHatchPatternType {
|
|
|
35
35
|
Custom = 2
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Defines the hatch style for determining which areas to hatch.
|
|
39
39
|
*/
|
|
40
40
|
export declare enum AcDbHatchStyle {
|
|
41
41
|
/**
|
|
@@ -57,21 +57,77 @@ export declare enum AcDbHatchStyle {
|
|
|
57
57
|
Ignore = 2
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Represents a hatch entity in AutoCAD.
|
|
61
|
+
*
|
|
62
|
+
* A hatch is a 2D geometric object that fills an area with a pattern of lines, dots, or other shapes.
|
|
63
|
+
* Hatches are commonly used to represent materials, textures, or to distinguish different areas in drawings.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* // Create a hatch entity
|
|
68
|
+
* const hatch = new AcDbHatch();
|
|
69
|
+
* hatch.patternName = "ANSI31";
|
|
70
|
+
* hatch.patternType = AcDbHatchPatternType.Predefined;
|
|
71
|
+
* hatch.patternScale = 1.0;
|
|
72
|
+
* hatch.patternAngle = 0;
|
|
73
|
+
* hatch.hatchStyle = AcDbHatchStyle.Normal;
|
|
74
|
+
*
|
|
75
|
+
* // Add a loop to define the hatch boundary
|
|
76
|
+
* const loop = new AcGeLoop2d();
|
|
77
|
+
* loop.add(new AcGePoint2d(0, 0));
|
|
78
|
+
* loop.add(new AcGePoint2d(10, 0));
|
|
79
|
+
* loop.add(new AcGePoint2d(10, 5));
|
|
80
|
+
* loop.add(new AcGePoint2d(0, 5));
|
|
81
|
+
* hatch.add(loop);
|
|
82
|
+
*
|
|
83
|
+
* // Access hatch properties
|
|
84
|
+
* console.log(`Pattern name: ${hatch.patternName}`);
|
|
85
|
+
* console.log(`Pattern scale: ${hatch.patternScale}`);
|
|
86
|
+
* ```
|
|
61
87
|
*/
|
|
62
88
|
export declare class AcDbHatch extends AcDbEntity {
|
|
89
|
+
/** The underlying geometric area object */
|
|
63
90
|
private _geo;
|
|
91
|
+
/** The elevation (Z-coordinate) of the hatch plane */
|
|
64
92
|
private _elevation;
|
|
93
|
+
/** The definition lines for the hatch pattern */
|
|
65
94
|
private _definitionLines;
|
|
95
|
+
/** The name of the hatch pattern */
|
|
66
96
|
private _patternName;
|
|
97
|
+
/** The type of hatch pattern */
|
|
67
98
|
private _patternType;
|
|
99
|
+
/** The angle of the hatch pattern in radians */
|
|
68
100
|
private _patternAngle;
|
|
101
|
+
/** The scale factor for the hatch pattern */
|
|
69
102
|
private _patternScale;
|
|
103
|
+
/** The hatch style for determining which areas to hatch */
|
|
70
104
|
private _hatchStyle;
|
|
71
105
|
/**
|
|
72
|
-
*
|
|
106
|
+
* Creates a new hatch entity.
|
|
107
|
+
*
|
|
108
|
+
* This constructor initializes a hatch with default values.
|
|
109
|
+
* The elevation is 0, pattern type is Predefined, pattern scale is 1,
|
|
110
|
+
* pattern angle is 0, and hatch style is Normal.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const hatch = new AcDbHatch();
|
|
115
|
+
* hatch.patternName = "ANSI31";
|
|
116
|
+
* hatch.patternScale = 2.0;
|
|
117
|
+
* ```
|
|
73
118
|
*/
|
|
74
119
|
constructor();
|
|
120
|
+
/**
|
|
121
|
+
* Gets the definition lines for the hatch pattern.
|
|
122
|
+
*
|
|
123
|
+
* @returns Array of hatch pattern lines
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const definitionLines = hatch.definitionLines;
|
|
128
|
+
* console.log(`Number of definition lines: ${definitionLines.length}`);
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
75
131
|
get definitionLines(): AcGiHatchPatternLine[];
|
|
76
132
|
/**
|
|
77
133
|
* The pattern name of this hatch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbHatch.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbHatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,cAAc,EACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,oBAAoB,EACpB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;GAEG;AACH,oBAAY,oBAAoB;IAC9B;;;;;;;;OAQG;IACH,WAAW,IAAI;IACf;;;;;;;;OAQG;IACH,UAAU,IAAI;IACd;;;;;;OAMG;IACH,MAAM,IAAI;CACX;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB;;;;;OAKG;IACH,MAAM,IAAI;IACV;;;;OAIG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,MAAM,IAAI;CACX;AAED
|
|
1
|
+
{"version":3,"file":"AcDbHatch.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbHatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,cAAc,EACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,oBAAoB,EACpB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;GAEG;AACH,oBAAY,oBAAoB;IAC9B;;;;;;;;OAQG;IACH,WAAW,IAAI;IACf;;;;;;;;OAQG;IACH,UAAU,IAAI;IACd;;;;;;OAMG;IACH,MAAM,IAAI;CACX;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB;;;;;OAKG;IACH,MAAM,IAAI;IACV;;;;OAIG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,MAAM,IAAI;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,2CAA2C;IAC3C,OAAO,CAAC,IAAI,CAAY;IACxB,sDAAsD;IACtD,OAAO,CAAC,UAAU,CAAQ;IAC1B,iDAAiD;IACjD,OAAO,CAAC,gBAAgB,CAAwB;IAChD,oCAAoC;IACpC,OAAO,CAAC,YAAY,CAAQ;IAC5B,gCAAgC;IAChC,OAAO,CAAC,YAAY,CAAsB;IAC1C,gDAAgD;IAChD,OAAO,CAAC,aAAa,CAAQ;IAC7B,6CAA6C;IAC7C,OAAO,CAAC,aAAa,CAAQ;IAC7B,2DAA2D;IAC3D,OAAO,CAAC,WAAW,CAAgB;IAEnC;;;;;;;;;;;;;OAaG;;IAaH;;;;;;;;;;OAUG;IACH,IAAI,eAAe,2BAElB;IAED;;OAEG;IACH,IAAI,WAAW,IAGQ,MAAM,CAD5B;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED;;OAEG;IACH,IAAI,WAAW,IAGQ,oBAAoB,CAD1C;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,oBAAoB,EAE1C;IAED;;OAEG;IACH,IAAI,YAAY,IAGQ,MAAM,CAD7B;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED;;OAEG;IACH,IAAI,YAAY,IAGQ,MAAM,CAD7B;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED;;OAEG;IACH,IAAI,UAAU,IAGQ,cAAc,CADnC;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,cAAc,EAEnC;IAED;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,cAAc;IAIxB;;OAEG;IACH,IAAI,gBAAgB,cAMnB;IAED;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAQ5B"}
|
package/lib/entity/AcDbHatch.js
CHANGED
|
@@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
import { AcGeArea2d, AcGeBox3d } from '@mlightcad/geometry-engine';
|
|
17
17
|
import { AcDbEntity } from './AcDbEntity';
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Defines the type of hatch pattern.
|
|
20
20
|
*/
|
|
21
21
|
export var AcDbHatchPatternType;
|
|
22
22
|
(function (AcDbHatchPatternType) {
|
|
@@ -50,7 +50,7 @@ export var AcDbHatchPatternType;
|
|
|
50
50
|
AcDbHatchPatternType[AcDbHatchPatternType["Custom"] = 2] = "Custom";
|
|
51
51
|
})(AcDbHatchPatternType || (AcDbHatchPatternType = {}));
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Defines the hatch style for determining which areas to hatch.
|
|
54
54
|
*/
|
|
55
55
|
export var AcDbHatchStyle;
|
|
56
56
|
(function (AcDbHatchStyle) {
|
|
@@ -73,12 +73,49 @@ export var AcDbHatchStyle;
|
|
|
73
73
|
AcDbHatchStyle[AcDbHatchStyle["Ignore"] = 2] = "Ignore";
|
|
74
74
|
})(AcDbHatchStyle || (AcDbHatchStyle = {}));
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Represents a hatch entity in AutoCAD.
|
|
77
|
+
*
|
|
78
|
+
* A hatch is a 2D geometric object that fills an area with a pattern of lines, dots, or other shapes.
|
|
79
|
+
* Hatches are commonly used to represent materials, textures, or to distinguish different areas in drawings.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Create a hatch entity
|
|
84
|
+
* const hatch = new AcDbHatch();
|
|
85
|
+
* hatch.patternName = "ANSI31";
|
|
86
|
+
* hatch.patternType = AcDbHatchPatternType.Predefined;
|
|
87
|
+
* hatch.patternScale = 1.0;
|
|
88
|
+
* hatch.patternAngle = 0;
|
|
89
|
+
* hatch.hatchStyle = AcDbHatchStyle.Normal;
|
|
90
|
+
*
|
|
91
|
+
* // Add a loop to define the hatch boundary
|
|
92
|
+
* const loop = new AcGeLoop2d();
|
|
93
|
+
* loop.add(new AcGePoint2d(0, 0));
|
|
94
|
+
* loop.add(new AcGePoint2d(10, 0));
|
|
95
|
+
* loop.add(new AcGePoint2d(10, 5));
|
|
96
|
+
* loop.add(new AcGePoint2d(0, 5));
|
|
97
|
+
* hatch.add(loop);
|
|
98
|
+
*
|
|
99
|
+
* // Access hatch properties
|
|
100
|
+
* console.log(`Pattern name: ${hatch.patternName}`);
|
|
101
|
+
* console.log(`Pattern scale: ${hatch.patternScale}`);
|
|
102
|
+
* ```
|
|
77
103
|
*/
|
|
78
104
|
var AcDbHatch = /** @class */ (function (_super) {
|
|
79
105
|
__extends(AcDbHatch, _super);
|
|
80
106
|
/**
|
|
81
|
-
*
|
|
107
|
+
* Creates a new hatch entity.
|
|
108
|
+
*
|
|
109
|
+
* This constructor initializes a hatch with default values.
|
|
110
|
+
* The elevation is 0, pattern type is Predefined, pattern scale is 1,
|
|
111
|
+
* pattern angle is 0, and hatch style is Normal.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const hatch = new AcDbHatch();
|
|
116
|
+
* hatch.patternName = "ANSI31";
|
|
117
|
+
* hatch.patternScale = 2.0;
|
|
118
|
+
* ```
|
|
82
119
|
*/
|
|
83
120
|
function AcDbHatch() {
|
|
84
121
|
var _this = _super.call(this) || this;
|
|
@@ -93,6 +130,17 @@ var AcDbHatch = /** @class */ (function (_super) {
|
|
|
93
130
|
return _this;
|
|
94
131
|
}
|
|
95
132
|
Object.defineProperty(AcDbHatch.prototype, "definitionLines", {
|
|
133
|
+
/**
|
|
134
|
+
* Gets the definition lines for the hatch pattern.
|
|
135
|
+
*
|
|
136
|
+
* @returns Array of hatch pattern lines
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const definitionLines = hatch.definitionLines;
|
|
141
|
+
* console.log(`Number of definition lines: ${definitionLines.length}`);
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
96
144
|
get: function () {
|
|
97
145
|
return this._definitionLines;
|
|
98
146
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbHatch.js","sourceRoot":"","sources":["../../src/entity/AcDbHatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV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