dxfview 0.0.2
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/README.md +1 -0
- package/dist/dxfview.esm.min.js +7 -0
- package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
- package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
- package/dist/types/components/pop-panel/PopPanel.d.ts +14 -0
- package/dist/types/components/pop-panel/index.d.ts +1 -0
- package/dist/types/components/progress-bar/ProgressBar.d.ts +34 -0
- package/dist/types/components/progress-bar/index.d.ts +1 -0
- package/dist/types/components/settings/ProjectSettingsDef.d.ts +44 -0
- package/dist/types/components/settings/index.d.ts +1 -0
- package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
- package/dist/types/components/tool-tip/index.d.ts +1 -0
- package/dist/types/core/Configs.d.ts +238 -0
- package/dist/types/core/Constants.d.ts +164 -0
- package/dist/types/core/Units.d.ts +16 -0
- package/dist/types/core/VersionManager.d.ts +3 -0
- package/dist/types/core/camera-controls/CameraControls.d.ts +773 -0
- package/dist/types/core/camera-controls/Constants.d.ts +2 -0
- package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
- package/dist/types/core/camera-controls/index.d.ts +2 -0
- package/dist/types/core/camera-controls/types.d.ts +112 -0
- package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
- package/dist/types/core/camera-controls/utils/math-utils.d.ts +11 -0
- package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
- package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
- package/dist/types/core/canvas/Constants.d.ts +28 -0
- package/dist/types/core/canvas/Drawable.d.ts +87 -0
- package/dist/types/core/canvas/DrawableList.d.ts +29 -0
- package/dist/types/core/canvas/index.d.ts +4 -0
- package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
- package/dist/types/core/compare/CompareDrawable.d.ts +17 -0
- package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
- package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
- package/dist/types/core/compare/index.d.ts +4 -0
- package/dist/types/core/controls/CameraControlsEx.d.ts +34 -0
- package/dist/types/core/controls/index.d.ts +1 -0
- package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
- package/dist/types/core/dxf/DxfConstants.d.ts +15 -0
- package/dist/types/core/dxf/DxfLoader.d.ts +526 -0
- package/dist/types/core/dxf/DxfObject.d.ts +32 -0
- package/dist/types/core/dxf/DxfUtils.d.ts +79 -0
- package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/bspline.d.ts +8 -0
- package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
- package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
- package/dist/types/core/dxf/index.d.ts +10 -0
- package/dist/types/core/dxf/round10.d.ts +2 -0
- package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
- package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
- package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
- package/dist/types/core/dxf-parser/DxfParser.d.ts +327 -0
- package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
- package/dist/types/core/dxf-parser/ParseHelpers.d.ts +36 -0
- package/dist/types/core/dxf-parser/entities/3dface.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/arc.d.ts +16 -0
- package/dist/types/core/dxf-parser/entities/attdef.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/attrib.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/circle.d.ts +13 -0
- package/dist/types/core/dxf-parser/entities/dimension.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/ellipse.d.ts +15 -0
- package/dist/types/core/dxf-parser/entities/geomtry.d.ts +40 -0
- package/dist/types/core/dxf-parser/entities/hatch.d.ts +108 -0
- package/dist/types/core/dxf-parser/entities/image.d.ts +37 -0
- package/dist/types/core/dxf-parser/entities/insert.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/line.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +21 -0
- package/dist/types/core/dxf-parser/entities/mleader.d.ts +101 -0
- package/dist/types/core/dxf-parser/entities/mtext.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/point.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/polyline.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/ray.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/region.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/seqend.d.ts +8 -0
- package/dist/types/core/dxf-parser/entities/solid.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/spline.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/table.d.ts +42 -0
- package/dist/types/core/dxf-parser/entities/text.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/vertex.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/viewport.d.ts +46 -0
- package/dist/types/core/dxf-parser/entities/xline.d.ts +10 -0
- package/dist/types/core/dxf-parser/index.d.ts +27 -0
- package/dist/types/core/dxf-parser/objects/common.d.ts +15 -0
- package/dist/types/core/dxf-parser/objects/dictionary.d.ts +19 -0
- package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
- package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
- package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
- package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
- package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
- package/dist/types/core/font/BaseFont.d.ts +88 -0
- package/dist/types/core/font/FontManager.d.ts +107 -0
- package/dist/types/core/font/MeshFont.d.ts +44 -0
- package/dist/types/core/font/ShxFont.d.ts +108 -0
- package/dist/types/core/font/index.d.ts +1 -0
- package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +1 -0
- package/dist/types/core/font/shx/Shx.constants.d.ts +11 -0
- package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
- package/dist/types/core/font/shx/TextShape.d.ts +24 -0
- package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
- package/dist/types/core/font/shx/index.d.ts +1 -0
- package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
- package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
- package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
- package/dist/types/core/geometry-offset/index.d.ts +1 -0
- package/dist/types/core/helpers/BinaryReader.d.ts +24 -0
- package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
- package/dist/types/core/helpers/LoadingHelper.d.ts +46 -0
- package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
- package/dist/types/core/helpers/OSnapHelper.d.ts +167 -0
- package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
- package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
- package/dist/types/core/helpers/RafHelper.d.ts +18 -0
- package/dist/types/core/helpers/ZoomToRectHelper.d.ts +17 -0
- package/dist/types/core/helpers/index.d.ts +9 -0
- package/dist/types/core/index.d.ts +18 -0
- package/dist/types/core/indexeddb/AnnotationTable.d.ts +14 -0
- package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
- package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
- package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
- package/dist/types/core/indexeddb/IndexedDbManager.d.ts +29 -0
- package/dist/types/core/indexeddb/ViewpointTable.d.ts +14 -0
- package/dist/types/core/indexeddb/index.d.ts +6 -0
- package/dist/types/core/input/InputManager.d.ts +161 -0
- package/dist/types/core/input/index.d.ts +1 -0
- package/dist/types/core/license/AutoConfig.d.ts +17 -0
- package/dist/types/core/license/LicenseManager.d.ts +107 -0
- package/dist/types/core/license/PublicKey.d.ts +1 -0
- package/dist/types/core/license/index.d.ts +1 -0
- package/dist/types/core/markup/ArrowMarkup.d.ts +14 -0
- package/dist/types/core/markup/BaseMarkup.d.ts +28 -0
- package/dist/types/core/markup/CircleMarkup.d.ts +12 -0
- package/dist/types/core/markup/CloudLineMarkup.d.ts +10 -0
- package/dist/types/core/markup/CloudRectMarkup.d.ts +11 -0
- package/dist/types/core/markup/CloudRectWithTextMarkup.d.ts +43 -0
- package/dist/types/core/markup/Constants.d.ts +17 -0
- package/dist/types/core/markup/DotMarkup.d.ts +9 -0
- package/dist/types/core/markup/EllipseMarkup.d.ts +12 -0
- package/dist/types/core/markup/LeaderLineMarkup.d.ts +25 -0
- package/dist/types/core/markup/MarkupManager.d.ts +91 -0
- package/dist/types/core/markup/PolylineMarkup.d.ts +11 -0
- package/dist/types/core/markup/RectMarkup.d.ts +10 -0
- package/dist/types/core/markup/TextMarkup.d.ts +40 -0
- package/dist/types/core/markup/XMarkup.d.ts +10 -0
- package/dist/types/core/markup/index.d.ts +13 -0
- package/dist/types/core/model/Constants.d.ts +51 -0
- package/dist/types/core/model/Model.d.ts +18 -0
- package/dist/types/core/model/Model2d.d.ts +115 -0
- package/dist/types/core/model/index.d.ts +3 -0
- package/dist/types/core/patches/Constants.d.ts +4 -0
- package/dist/types/core/patches/Line.d.ts +2 -0
- package/dist/types/core/patches/Mesh.d.ts +2 -0
- package/dist/types/core/patches/Points.d.ts +2 -0
- package/dist/types/core/patches/index.d.ts +4 -0
- package/dist/types/core/undo-redo/AddAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/AddMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/AddMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/Command.d.ts +6 -0
- package/dist/types/core/undo-redo/RemoveAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/RemoveMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/RemoveMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/UndoRedoManager.d.ts +21 -0
- package/dist/types/core/undo-redo/UpdateMarkupCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/index.d.ts +9 -0
- package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
- package/dist/types/core/utils/ColorUtils.d.ts +21 -0
- package/dist/types/core/utils/CommonUtils.d.ts +125 -0
- package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
- package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +4 -0
- package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
- package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
- package/dist/types/core/utils/Event.d.ts +33 -0
- package/dist/types/core/utils/FpsUtils.d.ts +13 -0
- package/dist/types/core/utils/GeometryUtils.d.ts +111 -0
- package/dist/types/core/utils/Locale.d.ts +190 -0
- package/dist/types/core/utils/LogUtils.d.ts +7 -0
- package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
- package/dist/types/core/utils/MathUtils.d.ts +59 -0
- package/dist/types/core/utils/MergeUtils.d.ts +638 -0
- package/dist/types/core/utils/ObjectUtils.d.ts +87 -0
- package/dist/types/core/utils/PolygonUtils.d.ts +8 -0
- package/dist/types/core/utils/SVGObjectUtils.d.ts +16 -0
- package/dist/types/core/utils/SceneUtils.d.ts +26 -0
- package/dist/types/core/utils/SectionUtils.d.ts +11 -0
- package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
- package/dist/types/core/utils/index.d.ts +21 -0
- package/dist/types/core/viewers/BaseViewer.d.ts +265 -0
- package/dist/types/core/viewers/DxfViewer.d.ts +1372 -0
- package/dist/types/core/viewers/Plugin.d.ts +29 -0
- package/dist/types/core/viewers/ViewerEvent.d.ts +178 -0
- package/dist/types/core/viewers/index.d.ts +4 -0
- package/dist/types/export.doc.d.ts +10 -0
- package/dist/types/fetch-polyfill.d.ts +2 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +139 -0
- package/dist/types/plugins/annotation/AutoDrawAnnotation.d.ts +63 -0
- package/dist/types/plugins/annotation/BaseAnnotation.d.ts +113 -0
- package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +139 -0
- package/dist/types/plugins/annotation/CopyAnnotation.d.ts +36 -0
- package/dist/types/plugins/annotation/CopyDrawable.d.ts +26 -0
- package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +59 -0
- package/dist/types/plugins/annotation/RectAnnotation.d.ts +53 -0
- package/dist/types/plugins/annotation/RectDrawable.d.ts +42 -0
- package/dist/types/plugins/annotation/ShapeFinder.d.ts +51 -0
- package/dist/types/plugins/annotation/freeDrawDrawable.d.ts +21 -0
- package/dist/types/plugins/annotation/index.d.ts +8 -0
- package/dist/types/plugins/annotation/type.d.ts +182 -0
- package/dist/types/plugins/axis-gizmo/AxisGizmoPlugin.d.ts +49 -0
- package/dist/types/plugins/axis-gizmo/CoordinateAxes.d.ts +12 -0
- package/dist/types/plugins/axis-gizmo/index.d.ts +1 -0
- package/dist/types/plugins/bottom-bar/BottomBarPlugin.d.ts +44 -0
- package/dist/types/plugins/bottom-bar/index.d.ts +1 -0
- package/dist/types/plugins/divide/CoverLayerManager.d.ts +44 -0
- package/dist/types/plugins/divide/DivGeometryUtils.d.ts +66 -0
- package/dist/types/plugins/divide/DividePlugin.d.ts +181 -0
- package/dist/types/plugins/divide/FrameAnnotation.d.ts +142 -0
- package/dist/types/plugins/divide/FrameDrawable.d.ts +75 -0
- package/dist/types/plugins/divide/index.d.ts +6 -0
- package/dist/types/plugins/divide/types.d.ts +38 -0
- package/dist/types/plugins/hotpoint/HotpointPlugin.d.ts +93 -0
- package/dist/types/plugins/hotpoint/index.d.ts +1 -0
- package/dist/types/plugins/index.d.ts +12 -0
- package/dist/types/plugins/layer-manager/LayerManagerPlugin.d.ts +59 -0
- package/dist/types/plugins/layer-manager/index.d.ts +1 -0
- package/dist/types/plugins/local-model-uploader/IUploader.d.ts +10 -0
- package/dist/types/plugins/local-model-uploader/LocalDxfUploader.d.ts +19 -0
- package/dist/types/plugins/local-model-uploader/index.d.ts +1 -0
- package/dist/types/plugins/measure/AngleMeasureDrawable.d.ts +12 -0
- package/dist/types/plugins/measure/AngleMeasurement.d.ts +16 -0
- package/dist/types/plugins/measure/AreaMeasureDrawable.d.ts +14 -0
- package/dist/types/plugins/measure/AreaMeasurement.d.ts +31 -0
- package/dist/types/plugins/measure/BaseMeasureDrawable.d.ts +35 -0
- package/dist/types/plugins/measure/BaseMeasurement.d.ts +127 -0
- package/dist/types/plugins/measure/CoordinateMeasureDrawable.d.ts +10 -0
- package/dist/types/plugins/measure/CoordinateMeasurement.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasureDrawable.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasurement.d.ts +28 -0
- package/dist/types/plugins/measure/MeasurementPlugin.d.ts +131 -0
- package/dist/types/plugins/measure/index.d.ts +3 -0
- package/dist/types/plugins/overview-map/ImageDrawable.d.ts +41 -0
- package/dist/types/plugins/overview-map/LineDrawable.d.ts +20 -0
- package/dist/types/plugins/overview-map/OverviewMapDrawable.d.ts +24 -0
- package/dist/types/plugins/overview-map/OverviewMapPlugin.d.ts +156 -0
- package/dist/types/plugins/overview-map/TextDrawable.d.ts +50 -0
- package/dist/types/plugins/overview-map/index.d.ts +5 -0
- package/dist/types/plugins/screenshot/ScreenshotPlugin.d.ts +88 -0
- package/dist/types/plugins/screenshot/index.d.ts +1 -0
- package/dist/types/plugins/stats/StatsPlugin.d.ts +20 -0
- package/dist/types/plugins/stats/index.d.ts +1 -0
- package/dist/types/plugins/toolbars/DxfViewerToolbarPlugin.d.ts +67 -0
- package/dist/types/plugins/toolbars/MarkupToolbar.d.ts +33 -0
- package/dist/types/plugins/toolbars/Toolbar.config.d.ts +5 -0
- package/dist/types/plugins/toolbars/Toolbar.constants.d.ts +96 -0
- package/dist/types/plugins/toolbars/Toolbar.d.ts +102 -0
- package/dist/types/plugins/toolbars/index.d.ts +5 -0
- package/dist/types/version.d.ts +2 -0
- package/package.json +90 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Box3, BufferGeometry, Object3D, Layers, Material, Matrix4 } from "three";
|
|
2
|
+
export declare enum ObjectType {
|
|
3
|
+
Object = 0,
|
|
4
|
+
Point = 1,
|
|
5
|
+
Line = 2,
|
|
6
|
+
LineSegment = 3,
|
|
7
|
+
Mesh = 4
|
|
8
|
+
}
|
|
9
|
+
export declare type CallBack = (object: DxfObject) => void;
|
|
10
|
+
export declare class DxfObject {
|
|
11
|
+
name: string;
|
|
12
|
+
type: ObjectType;
|
|
13
|
+
matrix: Matrix4;
|
|
14
|
+
parent?: DxfObject;
|
|
15
|
+
children: DxfObject[];
|
|
16
|
+
layers: Layers;
|
|
17
|
+
renderOrder: number;
|
|
18
|
+
userData: any;
|
|
19
|
+
material?: Material;
|
|
20
|
+
geometry?: BufferGeometry;
|
|
21
|
+
matrixWorld?: Matrix4;
|
|
22
|
+
constructor(type?: ObjectType);
|
|
23
|
+
add(object: DxfObject, ...args: DxfObject[]): this;
|
|
24
|
+
remove(object: DxfObject, ...args: DxfObject[]): this;
|
|
25
|
+
removeFromParent(): this;
|
|
26
|
+
clear(): this;
|
|
27
|
+
traverse(callback: CallBack): void;
|
|
28
|
+
clone(recursive?: boolean): DxfObject;
|
|
29
|
+
copy(source: DxfObject, recursive?: boolean): this;
|
|
30
|
+
convertToThreejsObject(recursive?: boolean): Object3D<import("three").Event> | undefined;
|
|
31
|
+
static getBox(object: DxfObject, box: THREE.Box3, parentMatrix?: Matrix4): Box3;
|
|
32
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DxfObject } from "../../core/dxf/DxfObject";
|
|
2
|
+
/**
|
|
3
|
+
* MergeHelper class is used to merge child objects for a given object
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class DxfUtils {
|
|
7
|
+
static mergeInfo: {
|
|
8
|
+
removedObjects: number;
|
|
9
|
+
mergedMeshes: number;
|
|
10
|
+
mergedLines: number;
|
|
11
|
+
mergedPoints: number;
|
|
12
|
+
mergedUnknownTypeObjects: number;
|
|
13
|
+
elapsedTime: number;
|
|
14
|
+
};
|
|
15
|
+
static resetMergeInfo(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Merges child objects for given object.
|
|
18
|
+
* it tries to merge objects in the same level and with the same parent;
|
|
19
|
+
* @param saveBatchInfo caller can set saveBatchInfo to true, so that s/he can
|
|
20
|
+
* get the object's original data before merged.
|
|
21
|
+
* While this takes some extra space, so, we'd like to add a flag here.
|
|
22
|
+
*/
|
|
23
|
+
static merge(object: DxfObject, saveBatchInfo?: boolean): void;
|
|
24
|
+
/**
|
|
25
|
+
* Merges child objects of given object.
|
|
26
|
+
* If objects' material are the same, they can be merged.
|
|
27
|
+
*/
|
|
28
|
+
private static mergeInner;
|
|
29
|
+
/**
|
|
30
|
+
* @param object parent object or THREE.Object3D[]
|
|
31
|
+
* @param i index of for object.children[]
|
|
32
|
+
* @param k index of for object.children[]
|
|
33
|
+
* @param dict to store merge-able object
|
|
34
|
+
* @param nonMergeIndexes used in order to improve performance
|
|
35
|
+
*/
|
|
36
|
+
private static tryHandleMergeableObjects;
|
|
37
|
+
/**
|
|
38
|
+
* TODO: Filters XC etc.
|
|
39
|
+
* there are cases where entities with xc and without xc are merged together
|
|
40
|
+
*/
|
|
41
|
+
private static isFilteredByOtherFactors;
|
|
42
|
+
/**
|
|
43
|
+
* Merges all objects of given object, just leaf children.
|
|
44
|
+
* If objects' material are the same, they can be merged.
|
|
45
|
+
* Better to call mergeInner first then deepMerge for a better performance.
|
|
46
|
+
* return \{ "added": THREE.Object3D[], "removed": THREE.Object3D[] \}
|
|
47
|
+
*/
|
|
48
|
+
static deepMerge(objects: DxfObject[], levelObject?: DxfObject | undefined, bRemovedAndAddedAfterMerge?: boolean, bRemoveEmptyObjectsAfterMerge?: boolean, saveBatchInfo?: boolean): {
|
|
49
|
+
added: DxfObject[];
|
|
50
|
+
removed: DxfObject[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* since we'll move geometry to another merged mesh under a group, below is the structure:
|
|
54
|
+
- root object
|
|
55
|
+
- merged objects group
|
|
56
|
+
- merged object 1
|
|
57
|
+
* need to consider a geometry's matrix for each level of ancestor
|
|
58
|
+
*/
|
|
59
|
+
private static applyMatrix;
|
|
60
|
+
/**
|
|
61
|
+
* Merges geometries for lines
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Removes a number from array
|
|
65
|
+
*/
|
|
66
|
+
private static removeFromArray;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if two geometries are mergable.
|
|
69
|
+
* It requires they have the same type and the same attributes.
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Checks if two objects are mergable.
|
|
73
|
+
* It requires
|
|
74
|
+
* - They are with the same masks.
|
|
75
|
+
* - Their userData.layerName must be the same if there is. This is useful for Dxf.
|
|
76
|
+
* - They have the same type or the same draw type( Mesh or Line or Point).
|
|
77
|
+
*/
|
|
78
|
+
private static areObjectsMergeable;
|
|
79
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export interface PatternLine {
|
|
3
|
+
origin: THREE.Vector2;
|
|
4
|
+
delta: THREE.Vector2;
|
|
5
|
+
angle: number;
|
|
6
|
+
pattern: number[];
|
|
7
|
+
patternSum: number[];
|
|
8
|
+
patternLength: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function createHatchPatternShaderMaterial(patternLines: PatternLine[], patternAngle: number, cameraZoomUniform: {
|
|
11
|
+
value: number;
|
|
12
|
+
}, color: THREE.Color, fixedThicknessInWorldCoord?: number): THREE.Material;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export declare class LinePatternShaders {
|
|
3
|
+
/**
|
|
4
|
+
* Creates line shader by given pattern.
|
|
5
|
+
* Note: remember to call line.computeLineDistances() in order to make it work!
|
|
6
|
+
*/
|
|
7
|
+
static createLineShaderMaterial(pattern: number[], color: number, scale: number, viewportScaleUniform: {
|
|
8
|
+
value: number;
|
|
9
|
+
}, cameraZoomUniform: {
|
|
10
|
+
value: number;
|
|
11
|
+
}): THREE.Material;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied and ported to code standard as the b-spline library is not maintained any longer.
|
|
3
|
+
* Source:
|
|
4
|
+
* https://github.com/thibauts/b-spline
|
|
5
|
+
* Copyright (c) 2015 Thibaut Séguy <thibaut.seguy@gmail.com>
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: (t: number, degree: number, points: number[][], knots: number[], weights?: number[]) => number[];
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare type DxfMTextContentElement = DxfMTextContentElement[] | string | {
|
|
5
|
+
/** font family */
|
|
6
|
+
f?: string;
|
|
7
|
+
/** bold */
|
|
8
|
+
b?: 0 | 1;
|
|
9
|
+
/** italic */
|
|
10
|
+
i?: 0 | 1;
|
|
11
|
+
/** code page */
|
|
12
|
+
c?: number;
|
|
13
|
+
/** pitch */
|
|
14
|
+
p?: number;
|
|
15
|
+
/** angle in degrees */
|
|
16
|
+
Q?: number;
|
|
17
|
+
/** character height (with unit) */
|
|
18
|
+
H?: [number, string];
|
|
19
|
+
/** character width (with unit) */
|
|
20
|
+
W?: [number, string];
|
|
21
|
+
/** stacking */
|
|
22
|
+
S?: [string, "^" | "/" | "#", string];
|
|
23
|
+
/** alignment (0: bottom, 1: center, 2: top) */
|
|
24
|
+
A?: 0 | 1 | 2;
|
|
25
|
+
/** color index */
|
|
26
|
+
C?: number;
|
|
27
|
+
/** character spacing */
|
|
28
|
+
T?: number;
|
|
29
|
+
/** underscore */
|
|
30
|
+
L?: 0 | 1;
|
|
31
|
+
/** overscore */
|
|
32
|
+
O?: 0 | 1;
|
|
33
|
+
/** strike through */
|
|
34
|
+
K?: 0 | 1;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
* [{f:""},
|
|
39
|
+
* {W:[,]},
|
|
40
|
+
* {C:number},
|
|
41
|
+
* ...
|
|
42
|
+
* ""] // The last one must be the test string
|
|
43
|
+
*/
|
|
44
|
+
export declare const parseDxfMTextContent: (s: string, options?: {
|
|
45
|
+
readonly encoding?: string | TextDecoder | undefined;
|
|
46
|
+
} | undefined) => DxfMTextContentElement[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DxfTextContentElement {
|
|
2
|
+
/** text content */
|
|
3
|
+
text: string;
|
|
4
|
+
/** strike-through */
|
|
5
|
+
k?: 1;
|
|
6
|
+
/** overscore */
|
|
7
|
+
o?: 1;
|
|
8
|
+
/** underscore */
|
|
9
|
+
u?: 1;
|
|
10
|
+
}
|
|
11
|
+
export declare const decodeDxfTextCharacterCodes: (text: string, mbcsEncoding?: string | TextDecoder) => string;
|
|
12
|
+
export declare const decodeDxfTextUnicodeCodePoints: (text: string) => string;
|
|
13
|
+
export declare const decodeDxfTextMbcsCharacterCodes: (text: string, encoding: string | TextDecoder) => string;
|
|
14
|
+
export declare const parseDxfTextContent: (text: string, options?: {
|
|
15
|
+
readonly encoding?: string | TextDecoder;
|
|
16
|
+
}) => DxfTextContentElement[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./DxfCompare";
|
|
2
|
+
export * from "./DxfLoader";
|
|
3
|
+
export * as bspline from "./bspline";
|
|
4
|
+
export * from "./dxfom-mtext";
|
|
5
|
+
export * as round10 from "./round10";
|
|
6
|
+
export * from "./DxfConstants";
|
|
7
|
+
export * from "./DxfUtils";
|
|
8
|
+
export * from "./HatchPatternShaders";
|
|
9
|
+
export * from "./LinePatternShaders";
|
|
10
|
+
export * from "./dxfom-text";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutoCad files sometimes use an indexed color value between 1 and 255 inclusive.
|
|
3
|
+
* Each value corresponds to a color. index 1 is red, that is 16711680 or 0xFF0000.
|
|
4
|
+
* index 0 and 256, while included in this array, are actually reserved for inheritance
|
|
5
|
+
* values in AutoCad so they should not be used for index color lookups.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: number[];
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IGroup {
|
|
2
|
+
code: number;
|
|
3
|
+
value: number | string | boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare abstract class DxfBaseReader {
|
|
6
|
+
protected pointer: number;
|
|
7
|
+
protected eof: boolean;
|
|
8
|
+
lastReadGroup: IGroup | undefined;
|
|
9
|
+
abstract next(): IGroup;
|
|
10
|
+
abstract hasNext(): boolean;
|
|
11
|
+
abstract isEOF(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "./DxfBaseReader";
|
|
2
|
+
export default class DxfBinaryReader extends DxfBaseReader {
|
|
3
|
+
private reader;
|
|
4
|
+
private decoder;
|
|
5
|
+
private int8Array;
|
|
6
|
+
private caches;
|
|
7
|
+
constructor(data: ArrayBuffer);
|
|
8
|
+
next(): IGroup;
|
|
9
|
+
hasNext(): boolean;
|
|
10
|
+
isEOF(): boolean;
|
|
11
|
+
private parseGroupValue;
|
|
12
|
+
private readNullTerminatedString;
|
|
13
|
+
private ReadBinaryData;
|
|
14
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
import IGeometry, { IEntity, IPoint } from "./entities/geomtry";
|
|
4
|
+
import { IObject, IObjectParser } from "./objects/common";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare enum BlockTypeFlags {
|
|
9
|
+
None = 0,
|
|
10
|
+
AnonymousBlock = 1,
|
|
11
|
+
NonConstantAttributeDefinitions = 2,
|
|
12
|
+
XRef = 4,
|
|
13
|
+
XRefOverlay = 8,
|
|
14
|
+
ExternallyDependent = 16,
|
|
15
|
+
ResolvedExternalReference = 32,
|
|
16
|
+
DefinitionExternalReference = 64
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Definition of a block. Which contains entities, name, handle, etc.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export interface IBlock {
|
|
23
|
+
entities: IEntity[];
|
|
24
|
+
ownerHandle: string;
|
|
25
|
+
xrefPath: string;
|
|
26
|
+
name: string;
|
|
27
|
+
name2: string;
|
|
28
|
+
handle: string;
|
|
29
|
+
layer: string;
|
|
30
|
+
position: IPoint;
|
|
31
|
+
paperSpace: boolean;
|
|
32
|
+
blockType: BlockTypeFlags;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Definition of a viewport.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export interface IViewport {
|
|
40
|
+
name: string;
|
|
41
|
+
lowerLeftCorner: IPoint;
|
|
42
|
+
upperRightCorner: IPoint;
|
|
43
|
+
center: IPoint;
|
|
44
|
+
snapBasePoint: IPoint;
|
|
45
|
+
snapSpacing: IPoint;
|
|
46
|
+
gridSpacing: IPoint;
|
|
47
|
+
viewDirectionFromTarget: IPoint;
|
|
48
|
+
viewTarget: IPoint;
|
|
49
|
+
aspectRatio: number;
|
|
50
|
+
lensLength: number;
|
|
51
|
+
frontClippingPlane: string | number | boolean;
|
|
52
|
+
backClippingPlane: string | number | boolean;
|
|
53
|
+
viewHeight: number;
|
|
54
|
+
snapRotationAngle: number;
|
|
55
|
+
viewTwistAngle: number;
|
|
56
|
+
orthographicType: string;
|
|
57
|
+
ucsOrigin: IPoint;
|
|
58
|
+
ucsXAxis: IPoint;
|
|
59
|
+
ucsYAxis: IPoint;
|
|
60
|
+
renderMode: string;
|
|
61
|
+
defaultLightingType: string;
|
|
62
|
+
defaultLightingOn: string;
|
|
63
|
+
ownerHandle: string;
|
|
64
|
+
ambientColor: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Viewport table definition.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export interface IViewportTableDefinition {
|
|
71
|
+
tableRecordsProperty: "viewports";
|
|
72
|
+
tableName: "viewport";
|
|
73
|
+
dxfSymbolName: "VPORT";
|
|
74
|
+
parseTableRecords(): IViewport[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Line type.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export interface ILineType {
|
|
81
|
+
name: string;
|
|
82
|
+
description: string;
|
|
83
|
+
pattern: number[];
|
|
84
|
+
patternLength: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Line type table definition.
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export interface ILineTypeTableDefinition {
|
|
91
|
+
tableRecordsProperty: "lineTypes";
|
|
92
|
+
tableName: "lineType";
|
|
93
|
+
dxfSymbolName: "LTYPE";
|
|
94
|
+
parseTableRecords(): Record<string, ILineType>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Definition of a layer.
|
|
98
|
+
*/
|
|
99
|
+
export interface ILayer {
|
|
100
|
+
/**
|
|
101
|
+
* Unique layer name with the dxf/dwg file.
|
|
102
|
+
*/
|
|
103
|
+
name: string;
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
handle: string;
|
|
108
|
+
visible: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
colorIndex: number;
|
|
113
|
+
/**
|
|
114
|
+
* color in decimal
|
|
115
|
+
*/
|
|
116
|
+
color: number;
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
frozen: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
flag: number;
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
lineType: string;
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
lineweight: 0 | 5 | 9 | 13 | 15 | 18 | 20 | 25 | 30 | 35 | 40 | 50 | 53 | 60 | 70 | 80 | 90 | 100 | 106 | 120 | 140 | 158 | 200 | 211 | -3 | -2 | -1;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Layer table definition.
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export interface ILayerTableDefinition {
|
|
139
|
+
tableRecordsProperty: "layers";
|
|
140
|
+
tableName: "layer";
|
|
141
|
+
dxfSymbolName: "LAYER";
|
|
142
|
+
parseTableRecords(): Record<string, ILayer>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* BlockRecord
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
export interface IBlockRecord {
|
|
149
|
+
handle: string;
|
|
150
|
+
ownerHandle: string;
|
|
151
|
+
blockName: string;
|
|
152
|
+
layoutHandle: string;
|
|
153
|
+
blockInsertUnits: number;
|
|
154
|
+
blockExplodability: number;
|
|
155
|
+
blockScalability: number;
|
|
156
|
+
bitmap?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export interface IBlockRecordTableDefinition {
|
|
162
|
+
tableRecordsProperty: "blockRecords";
|
|
163
|
+
tableName: "blockRecord";
|
|
164
|
+
dxfSymbolName: "BLOCK_RECORD";
|
|
165
|
+
parseTableRecords(): Record<string, IBlockRecord>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Definition of a style.
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
export interface IStyle {
|
|
172
|
+
handle: string;
|
|
173
|
+
ownerHandle: string;
|
|
174
|
+
styleName: string;
|
|
175
|
+
priorTextHeight: number;
|
|
176
|
+
textHeight: number;
|
|
177
|
+
xScale: number;
|
|
178
|
+
rotation: number;
|
|
179
|
+
mirrorType: number;
|
|
180
|
+
fontFile: string;
|
|
181
|
+
bigFontFile: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Style table definition.
|
|
185
|
+
* @internal
|
|
186
|
+
*/
|
|
187
|
+
export interface IStyleTableDefinition {
|
|
188
|
+
tableRecordsProperty: "styles";
|
|
189
|
+
tableName: "style";
|
|
190
|
+
dxfSymbolName: "STYLE";
|
|
191
|
+
parseTableRecords(): Record<string, IStyle>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Dim style.
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
export interface IDimStyle {
|
|
198
|
+
styleName: string;
|
|
199
|
+
DIMSCALE: number;
|
|
200
|
+
DIMASZ: number;
|
|
201
|
+
DIMEXO: string;
|
|
202
|
+
DIMEXE: string;
|
|
203
|
+
DIMSE1: string;
|
|
204
|
+
DIMSE2: string;
|
|
205
|
+
DIMTAD: string;
|
|
206
|
+
DIMTXT: string;
|
|
207
|
+
DIMGAP: number;
|
|
208
|
+
DIMCLRD: number;
|
|
209
|
+
DIMCLRT: number;
|
|
210
|
+
DIMLFAC: number;
|
|
211
|
+
DIMDEC: string;
|
|
212
|
+
DIMLDRBLK: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Dim style table definition
|
|
216
|
+
* @internal
|
|
217
|
+
*/
|
|
218
|
+
export interface IDimStyleTableDefinition {
|
|
219
|
+
tableRecordsProperty: "dimStyles";
|
|
220
|
+
tableName: "dimStyle";
|
|
221
|
+
dxfSymbolName: "DIMSTYLE";
|
|
222
|
+
parseTableRecords(): Record<string, IDimStyle>;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Table definitions.
|
|
226
|
+
* @internal
|
|
227
|
+
*/
|
|
228
|
+
export interface ITableDefinitions {
|
|
229
|
+
VPORT: IViewportTableDefinition;
|
|
230
|
+
LTYPE: ILineTypeTableDefinition;
|
|
231
|
+
LAYER: ILayerTableDefinition;
|
|
232
|
+
BLOCK_RECORD: IBlockRecordTableDefinition;
|
|
233
|
+
STYLE: IStyleTableDefinition;
|
|
234
|
+
DIMSTYLE: IDimStyleTableDefinition;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Base table
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
export interface IBaseTable {
|
|
241
|
+
handle: string;
|
|
242
|
+
ownerHandle: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Viewport table
|
|
246
|
+
* @internal
|
|
247
|
+
*/
|
|
248
|
+
export interface IViewportTable extends IBaseTable {
|
|
249
|
+
viewports: IViewport[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @internal
|
|
253
|
+
*/
|
|
254
|
+
export interface ILayerTypesTable extends IBaseTable {
|
|
255
|
+
lineTypes: Record<string, ILineType>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @internal
|
|
259
|
+
*/
|
|
260
|
+
export interface ILayersTable extends IBaseTable {
|
|
261
|
+
layers: Record<string, ILayer>;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* @internal
|
|
265
|
+
*/
|
|
266
|
+
export interface IStylesTable extends IBaseTable {
|
|
267
|
+
styles: Record<string, IStyle>;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
272
|
+
export interface IDimStyleTable extends IBaseTable {
|
|
273
|
+
dimStyles: Record<string, IDimStyle>;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @internal
|
|
277
|
+
*/
|
|
278
|
+
export interface IBlockRecordsTable extends IBaseTable {
|
|
279
|
+
blockRecords: Record<string, IBlockRecord>;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* @internal
|
|
283
|
+
*/
|
|
284
|
+
export interface ITables {
|
|
285
|
+
viewport: IViewportTable;
|
|
286
|
+
lineType: ILayerTypesTable;
|
|
287
|
+
layer: ILayersTable;
|
|
288
|
+
blockRecord: IBlockRecordsTable;
|
|
289
|
+
style: IStylesTable;
|
|
290
|
+
dimStyle: IDimStyleTable;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* @internal
|
|
294
|
+
*/
|
|
295
|
+
export declare type ITable = IViewportTable | ILayerTypesTable | ILayersTable | IBlockRecordsTable | IStylesTable | IDimStyleTable;
|
|
296
|
+
/**
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
export interface IDxf {
|
|
300
|
+
header: Record<string, IPoint | number>;
|
|
301
|
+
entities: IEntity[];
|
|
302
|
+
blocks: Record<string, IBlock>;
|
|
303
|
+
tables: ITables;
|
|
304
|
+
objects: Record<string, IObject[]>;
|
|
305
|
+
}
|
|
306
|
+
export default class DxfParser {
|
|
307
|
+
private encoding?;
|
|
308
|
+
private _entityHandlers;
|
|
309
|
+
private _objectHandlers;
|
|
310
|
+
private _layoutBlocks;
|
|
311
|
+
private unhandledSections;
|
|
312
|
+
private unhandledObjects;
|
|
313
|
+
private unhandledEntities;
|
|
314
|
+
private unsupportedLineTypes;
|
|
315
|
+
constructor(encoding?: string);
|
|
316
|
+
parse(source: string | ArrayBuffer): IDxf;
|
|
317
|
+
registerEntityHandler(handlerType: new () => IGeometry): void;
|
|
318
|
+
registerObjectHandler(handlerType: new () => IObjectParser): void;
|
|
319
|
+
parseSync(source: string | ArrayBuffer): IDxf;
|
|
320
|
+
parseStream(stream: Readable): Promise<IDxf>;
|
|
321
|
+
private _parse;
|
|
322
|
+
/**
|
|
323
|
+
* Splits a string to string array by line separator, "\r\n", "\r", "\n", etc.
|
|
324
|
+
* We do this instead of using "String.prototype.split(/\r\n|\r|\n/g)", because it is extreamly slow!
|
|
325
|
+
*/
|
|
326
|
+
private splitByLineSeparator;
|
|
327
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IGroup, DxfBaseReader } from './DxfBaseReader';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Based off the AutoCad 2012 DXF Reference
|
|
5
|
+
* http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
|
|
6
|
+
*
|
|
7
|
+
* Reads through an array representing lines of a dxf file. Takes an array and
|
|
8
|
+
* provides an easy interface to extract group code and value pairs.
|
|
9
|
+
* @param data - an array where each element represents a line in the dxf file
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
export default class DxfTextRender extends DxfBaseReader {
|
|
13
|
+
private data;
|
|
14
|
+
constructor(data: string[]);
|
|
15
|
+
/**
|
|
16
|
+
* Gets the next group (code, value) from the array. A group is two consecutive elements
|
|
17
|
+
* in the array. The first is the code, the second is the value.
|
|
18
|
+
* @returns {{code: Number}|*}
|
|
19
|
+
*/
|
|
20
|
+
next(): IGroup;
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if there is another code/value pair (2 elements in the array).
|
|
23
|
+
* @returns {boolean}
|
|
24
|
+
*/
|
|
25
|
+
hasNext(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true if the scanner is at the end of the array
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
isEOF(): boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "./DxfBaseReader";
|
|
2
|
+
import { IEntity, IPoint } from "./entities/geomtry";
|
|
3
|
+
import { IObject } from "./objects/common";
|
|
4
|
+
export declare const originalTypes: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Returns the truecolor value of the given AutoCad color index value
|
|
7
|
+
* @return {Number} truecolor value as a number
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAcadColor(index: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Parses the 2D or 3D coordinate, vector, or point. When complete,
|
|
12
|
+
* the scanner remains on the last group of the coordinate.
|
|
13
|
+
* @param {*} scanner
|
|
14
|
+
*/
|
|
15
|
+
export declare function parsePoint(scanner: DxfBaseReader): IPoint;
|
|
16
|
+
/**
|
|
17
|
+
* Parses 16 numbers as an array. When complete,
|
|
18
|
+
* the scanner remains on the last group of the value.
|
|
19
|
+
* @param {*} scanner
|
|
20
|
+
* @param {*} groupCode
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseMatrix(scanner: DxfBaseReader, groupCode: number): number[];
|
|
23
|
+
/**
|
|
24
|
+
* Attempts to parse codes common to all entities. Returns true if the group
|
|
25
|
+
* was handled by this function.
|
|
26
|
+
* @param {*} entity - the entity currently being parsed
|
|
27
|
+
* @param {*} curr - the current group being parsed
|
|
28
|
+
*/
|
|
29
|
+
export declare function checkCommonEntityProperties(entity: IEntity, curr: IGroup): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Attempts to parse codes common to all objects. Returns true if the group
|
|
32
|
+
* was handled by this function.
|
|
33
|
+
* @param {*} object - the object currently being parsed
|
|
34
|
+
* @param {*} curr - the current group being parsed
|
|
35
|
+
*/
|
|
36
|
+
export declare function checkCommonObjectProperties(object: IObject, curr: IGroup): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
3
|
+
export interface I3DfaceEntity extends IEntity {
|
|
4
|
+
shape: boolean;
|
|
5
|
+
hasContinuousLinetypePattern: boolean;
|
|
6
|
+
vertices: IPoint[];
|
|
7
|
+
}
|
|
8
|
+
export default class ThreeDface implements IGeometry {
|
|
9
|
+
ForEntityName: "3DFACE";
|
|
10
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): I3DfaceEntity;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
3
|
+
export interface IArcEntity extends IEntity {
|
|
4
|
+
center: IPoint;
|
|
5
|
+
radius: number;
|
|
6
|
+
startAngle: number;
|
|
7
|
+
endAngle: number;
|
|
8
|
+
angleLength: number;
|
|
9
|
+
extrusionDirectionX: number;
|
|
10
|
+
extrusionDirectionY: number;
|
|
11
|
+
extrusionDirectionZ: number;
|
|
12
|
+
}
|
|
13
|
+
export default class Arc implements IGeometry {
|
|
14
|
+
ForEntityName: "ARC";
|
|
15
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): IArcEntity;
|
|
16
|
+
}
|