@x-viewer/core 0.9.0
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 +2 -0
- package/dist/index.esm.js +11790 -0
- package/dist/types/Locale.d.ts +23 -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/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 +288 -0
- package/dist/types/core/Constants.d.ts +81 -0
- package/dist/types/core/Units.d.ts +16 -0
- package/dist/types/core/VersionManager.d.ts +14 -0
- package/dist/types/core/camera/CameraManager.d.ts +80 -0
- package/dist/types/core/camera/index.d.ts +1 -0
- package/dist/types/core/camera-controls/CameraControls.d.ts +744 -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 +3 -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 +14 -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 +31 -0
- package/dist/types/core/canvas/Drawable.d.ts +98 -0
- package/dist/types/core/canvas/DrawableList.d.ts +40 -0
- package/dist/types/core/canvas/MarkerDrawable.d.ts +30 -0
- package/dist/types/core/canvas/PathDrawable.d.ts +39 -0
- package/dist/types/core/canvas/index.d.ts +6 -0
- package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
- package/dist/types/core/compare/CompareDrawable.d.ts +18 -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/components/Container.d.ts +38 -0
- package/dist/types/core/components/ProgressBar.d.ts +31 -0
- package/dist/types/core/components/Spinner.d.ts +16 -0
- package/dist/types/core/components/index.d.ts +3 -0
- package/dist/types/core/controls/CameraControlsEx.d.ts +37 -0
- package/dist/types/core/controls/Control.d.ts +17 -0
- package/dist/types/core/controls/OrbitControls.d.ts +13 -0
- package/dist/types/core/controls/PlanControls.d.ts +13 -0
- package/dist/types/core/controls/index.d.ts +4 -0
- package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
- package/dist/types/core/dxf/DxfConstants.d.ts +33 -0
- package/dist/types/core/dxf/DxfLoader.d.ts +557 -0
- package/dist/types/core/dxf/DxfObject.d.ts +33 -0
- package/dist/types/core/dxf/DxfUtils.d.ts +45 -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 +7 -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 +1 -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 +324 -0
- package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
- package/dist/types/core/dxf-parser/ParseHelpers.d.ts +45 -0
- package/dist/types/core/dxf-parser/entities/3dface.d.ts +13 -0
- package/dist/types/core/dxf-parser/entities/arc.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/attdef.d.ts +33 -0
- package/dist/types/core/dxf-parser/entities/attrib.d.ts +33 -0
- package/dist/types/core/dxf-parser/entities/circle.d.ts +15 -0
- package/dist/types/core/dxf-parser/entities/dimension.d.ts +24 -0
- package/dist/types/core/dxf-parser/entities/ellipse.d.ts +17 -0
- package/dist/types/core/dxf-parser/entities/geomtry.d.ts +42 -0
- package/dist/types/core/dxf-parser/entities/hatch.d.ts +110 -0
- package/dist/types/core/dxf-parser/entities/image.d.ts +39 -0
- package/dist/types/core/dxf-parser/entities/insert.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/line.d.ts +12 -0
- package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/mleader.d.ts +103 -0
- package/dist/types/core/dxf-parser/entities/mtext.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/point.d.ts +13 -0
- package/dist/types/core/dxf-parser/entities/polyline.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/ray.d.ts +12 -0
- package/dist/types/core/dxf-parser/entities/region.d.ts +12 -0
- package/dist/types/core/dxf-parser/entities/seqend.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/solid.d.ts +12 -0
- package/dist/types/core/dxf-parser/entities/spline.d.ts +25 -0
- package/dist/types/core/dxf-parser/entities/table.d.ts +44 -0
- package/dist/types/core/dxf-parser/entities/text.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/vertex.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/viewport.d.ts +56 -0
- package/dist/types/core/dxf-parser/entities/xline.d.ts +12 -0
- package/dist/types/core/dxf-parser/index.d.ts +27 -0
- package/dist/types/core/dxf-parser/objects/common.d.ts +26 -0
- package/dist/types/core/dxf-parser/objects/dictionary.d.ts +23 -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/effect/EffectManager.d.ts +43 -0
- package/dist/types/core/effect/index.d.ts +1 -0
- package/dist/types/core/font/BaseFont.d.ts +41 -0
- package/dist/types/core/font/FontManager.d.ts +52 -0
- package/dist/types/core/font/MeshFont.d.ts +14 -0
- package/dist/types/core/font/ShxFont.d.ts +49 -0
- package/dist/types/core/font/index.d.ts +1 -0
- package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +4 -0
- package/dist/types/core/font/shx/Shx.constants.d.ts +20 -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 +23 -0
- package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
- package/dist/types/core/helpers/InstantiateHelper.d.ts +26 -0
- package/dist/types/core/helpers/LoadingHelper.d.ts +65 -0
- package/dist/types/core/helpers/MeshBvhHelper.d.ts +15 -0
- package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
- package/dist/types/core/helpers/OSnapHelper.d.ts +159 -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 +20 -0
- package/dist/types/core/helpers/index.d.ts +11 -0
- package/dist/types/core/index.d.ts +24 -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 +49 -0
- package/dist/types/core/indexeddb/index.d.ts +4 -0
- package/dist/types/core/input-manager/InputManager.d.ts +147 -0
- package/dist/types/core/input-manager/index.d.ts +1 -0
- package/dist/types/core/interactions/Interaction.d.ts +10 -0
- package/dist/types/core/interactions/Viewer2dInteraction.d.ts +17 -0
- package/dist/types/core/interactions/Viewer3dInteraction.d.ts +26 -0
- package/dist/types/core/interactions/index.d.ts +1 -0
- package/dist/types/core/materials/BimTilesHighlightMaterial.d.ts +21 -0
- package/dist/types/core/materials/BimTilesMaterial.d.ts +26 -0
- package/dist/types/core/materials/BimTilesPickMaterial.d.ts +9 -0
- package/dist/types/core/materials/BimTilesTransparentMaterial.d.ts +20 -0
- package/dist/types/core/materials/StandardMaterialEx.d.ts +16 -0
- package/dist/types/core/materials/constants.d.ts +0 -0
- package/dist/types/core/materials/index.d.ts +5 -0
- package/dist/types/core/model/Constants.d.ts +58 -0
- package/dist/types/core/model/Model.d.ts +18 -0
- package/dist/types/core/model/Model2d.d.ts +142 -0
- package/dist/types/core/model/Model3d.d.ts +137 -0
- package/dist/types/core/model/bimtiles/BatchedMeshesParser.d.ts +26 -0
- package/dist/types/core/model/bimtiles/BimTilesConfigParser.d.ts +43 -0
- package/dist/types/core/model/bimtiles/BimTilesData.d.ts +280 -0
- package/dist/types/core/model/bimtiles/BimTilesMaterialManager.d.ts +139 -0
- package/dist/types/core/model/bimtiles/BimTilesModel.d.ts +67 -0
- package/dist/types/core/model/bimtiles/BimTilesPropertyParser.d.ts +42 -0
- package/dist/types/core/model/bimtiles/BimTilesRenderer.d.ts +49 -0
- package/dist/types/core/model/bimtiles/InstancedMeshesParser.d.ts +37 -0
- package/dist/types/core/model/bimtiles/TileParser.d.ts +11 -0
- package/dist/types/core/model/bimtiles/Utils.d.ts +29 -0
- package/dist/types/core/model/index.d.ts +6 -0
- package/dist/types/core/patches/Constants.d.ts +6 -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/patches/shaders/ShaderChunk.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/common_ex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/id_pars_vertex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/id_vertex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/outine_bc_vertex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/outline_bc_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/outline_bc_pars_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/outline_bc_pars_vertex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/state_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/state_highlight_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/state_pars_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderChunk/state_transparent_fragment.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderLib/pick_ex.glsl.d.ts +2 -0
- package/dist/types/core/patches/shaders/shaderLib/standard_ex.glsl.d.ts +2 -0
- package/dist/types/core/pick/PickManager.d.ts +52 -0
- package/dist/types/core/pick/index.d.ts +1 -0
- package/dist/types/core/scene/SceneManager.d.ts +48 -0
- package/dist/types/core/scene/index.d.ts +1 -0
- package/dist/types/core/shp-js/BitView.d.ts +12 -0
- package/dist/types/core/shp-js/SHPLoader.d.ts +12 -0
- package/dist/types/core/shp-js/Shp.d.ts +10 -0
- package/dist/types/core/shp-js/ShpThree.d.ts +23 -0
- package/dist/types/core/shp-js/index.d.ts +4 -0
- package/dist/types/core/text-texture/TextTexture.d.ts +45 -0
- package/dist/types/core/text-texture/index.d.ts +1 -0
- package/dist/types/core/undo/Command.d.ts +6 -0
- package/dist/types/core/undo/UndoManager.d.ts +24 -0
- package/dist/types/core/undo/index.d.ts +2 -0
- package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
- package/dist/types/core/utils/CancelablePromise.d.ts +6 -0
- package/dist/types/core/utils/ColorUtils.d.ts +25 -0
- package/dist/types/core/utils/CommonUtils.d.ts +141 -0
- package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
- package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +10 -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/ExportUtils.d.ts +61 -0
- package/dist/types/core/utils/FpsUtils.d.ts +13 -0
- package/dist/types/core/utils/GeometryUtils.d.ts +78 -0
- package/dist/types/core/utils/LodashUtils.d.ts +208 -0
- package/dist/types/core/utils/LogUtils.d.ts +29 -0
- package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
- package/dist/types/core/utils/MathUtils.d.ts +41 -0
- package/dist/types/core/utils/MergeUtils.d.ts +126 -0
- package/dist/types/core/utils/ObjectUtils.d.ts +216 -0
- package/dist/types/core/utils/PolygonUtils.d.ts +9 -0
- package/dist/types/core/utils/SVGObjectUtils.d.ts +22 -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/SimplifyUtils.d.ts +15 -0
- package/dist/types/core/utils/TextureUtils.d.ts +16 -0
- package/dist/types/core/utils/UVUtils.d.ts +21 -0
- package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
- package/dist/types/core/utils/index.d.ts +26 -0
- package/dist/types/core/viewers/BaseViewer.d.ts +253 -0
- package/dist/types/core/viewers/BimTilesViewer.d.ts +130 -0
- package/dist/types/core/viewers/Constants.d.ts +9 -0
- package/dist/types/core/viewers/Plugin.d.ts +30 -0
- package/dist/types/core/viewers/Viewer2d.d.ts +413 -0
- package/dist/types/core/viewers/Viewer3d.d.ts +136 -0
- package/dist/types/core/viewers/Viewer3dLite.d.ts +144 -0
- package/dist/types/core/viewers/ViewerEvent.d.ts +108 -0
- package/dist/types/core/viewers/index.d.ts +8 -0
- package/dist/types/core/webcam/WebCam.d.ts +28 -0
- package/dist/types/core/webcam/index.d.ts +1 -0
- package/dist/types/core/workers/CreateMeshBvh.worker.d.ts +1 -0
- package/dist/types/core/workers/GenerateMeshBvhWorker.d.ts +17 -0
- package/dist/types/core/workers/index.d.ts +1 -0
- package/dist/types/export.doc.d.ts +9 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/version.d.ts +2 -0
- package/package.json +88 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { DxfChange } from "./DxfCompare";
|
|
3
|
+
import { DxfObject } from "./DxfObject";
|
|
4
|
+
import { Units } from "../../core/Units";
|
|
5
|
+
import { IBlock, IDxf, IEntity, ILayer, ILayoutObject, IPoint, IViewport, IViewportEntity, TableCell } from "../../core/dxf-parser";
|
|
6
|
+
import { ImageFlags } from "../../core/dxf-parser/entities/image";
|
|
7
|
+
import { IMLeaderContextData } from "../../core/dxf-parser/entities/mleader";
|
|
8
|
+
import { ISpatialFilterObject } from "../../core/dxf-parser/objects/spatialfilter";
|
|
9
|
+
import { FontManager } from "../../core/font";
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export interface DxfData extends IDxf {
|
|
14
|
+
threejsObject: THREE.Object3D;
|
|
15
|
+
layersAndThreejsObjects: Record<string, THREE.Object3D[]>;
|
|
16
|
+
loadedEntityCount: number;
|
|
17
|
+
layoutViewportsMap: Record<string, IViewportEntity[]>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Dxf/dwg layer, which contains a number of objects in it.
|
|
21
|
+
*
|
|
22
|
+
* A layer has "name", "handle", "color", "visible" and many other properties.
|
|
23
|
+
*
|
|
24
|
+
* We can change a layer's visibility, color, etc.
|
|
25
|
+
*/
|
|
26
|
+
export type DxfLayer = ILayer;
|
|
27
|
+
/**
|
|
28
|
+
* Dxf entity, which can be an arc, circle, attach, line, insert, text, etc.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export interface DxfEntity extends IEntity {
|
|
32
|
+
threejsObject?: THREE.Object3D;
|
|
33
|
+
dimStyleName: string;
|
|
34
|
+
dimensionType?: number;
|
|
35
|
+
anchorPoint?: THREE.Vector3;
|
|
36
|
+
block?: string;
|
|
37
|
+
majorAxisEndPoint?: THREE.Vector2 | THREE.Vector3;
|
|
38
|
+
axisRatio?: number;
|
|
39
|
+
center?: THREE.Vector3;
|
|
40
|
+
startAngle?: number;
|
|
41
|
+
endAngle?: number;
|
|
42
|
+
style?: number;
|
|
43
|
+
text?: string;
|
|
44
|
+
height?: number;
|
|
45
|
+
width?: number;
|
|
46
|
+
position?: THREE.Vector3;
|
|
47
|
+
blockPosition?: IPoint;
|
|
48
|
+
rotation?: number;
|
|
49
|
+
directionVector?: THREE.Vector3;
|
|
50
|
+
attachmentPoint?: number;
|
|
51
|
+
drawingDirection?: number;
|
|
52
|
+
controlPoints?: IPoint[];
|
|
53
|
+
degreeOfSplineCurve?: number;
|
|
54
|
+
knotValues?: number[];
|
|
55
|
+
numberOfControlPoints: number;
|
|
56
|
+
vertices?: IPoint[];
|
|
57
|
+
shape: boolean;
|
|
58
|
+
isPolyfaceMesh: boolean;
|
|
59
|
+
pathType: number;
|
|
60
|
+
direction: number;
|
|
61
|
+
hasHookline: boolean;
|
|
62
|
+
textWidth: number;
|
|
63
|
+
dimensionStyle: string;
|
|
64
|
+
arrowFlag: number;
|
|
65
|
+
arrowHeight: number;
|
|
66
|
+
arrowHeadScale: number;
|
|
67
|
+
arrowHeadBlockHandle: string;
|
|
68
|
+
contextData?: IMLeaderContextData;
|
|
69
|
+
enableDogLeg: boolean;
|
|
70
|
+
leaderLineType: number;
|
|
71
|
+
arrowHeadId: string;
|
|
72
|
+
arrowHeadSize: number;
|
|
73
|
+
radius?: number;
|
|
74
|
+
points?: THREE.Vector3[];
|
|
75
|
+
startPoint?: THREE.Vector3;
|
|
76
|
+
endPoint?: THREE.Vector3;
|
|
77
|
+
textHeight: number;
|
|
78
|
+
halign?: number;
|
|
79
|
+
valign?: number;
|
|
80
|
+
mirrored?: number;
|
|
81
|
+
textStyle?: string;
|
|
82
|
+
lineSpaceFactor?: number;
|
|
83
|
+
name?: string;
|
|
84
|
+
xScale?: number;
|
|
85
|
+
yScale?: number;
|
|
86
|
+
zScale?: number;
|
|
87
|
+
elevation?: number;
|
|
88
|
+
extrusionDirectionX?: number;
|
|
89
|
+
extrusionDirectionY?: number;
|
|
90
|
+
extrusionDirectionZ?: number;
|
|
91
|
+
extrusionDirection?: {
|
|
92
|
+
z: number;
|
|
93
|
+
};
|
|
94
|
+
entities?: IEntity[];
|
|
95
|
+
tag?: string;
|
|
96
|
+
prompt?: string;
|
|
97
|
+
scale?: number;
|
|
98
|
+
preset: boolean;
|
|
99
|
+
invisible: boolean;
|
|
100
|
+
documentType?: string;
|
|
101
|
+
version?: number;
|
|
102
|
+
leftUpX?: number;
|
|
103
|
+
leftUpY?: number;
|
|
104
|
+
leftUpZ?: number;
|
|
105
|
+
rightDownX?: number;
|
|
106
|
+
rightDownY?: number;
|
|
107
|
+
rightDownZ?: number;
|
|
108
|
+
tileModeDescriptor?: number;
|
|
109
|
+
binaryData?: string;
|
|
110
|
+
lengthOfBinaryData?: number;
|
|
111
|
+
image: string;
|
|
112
|
+
psBBox?: THREE.Box3;
|
|
113
|
+
msToPsMatrix?: THREE.Matrix4;
|
|
114
|
+
viewportThreejsObject?: DxfObject;
|
|
115
|
+
associatedLeafObjectSet?: Set<THREE.Object3D>;
|
|
116
|
+
associatedSpatialFilter?: DxfSpatialFilter;
|
|
117
|
+
imageSize?: IPoint;
|
|
118
|
+
imageDefHandle?: string;
|
|
119
|
+
uPixel?: IPoint;
|
|
120
|
+
vPixel?: IPoint;
|
|
121
|
+
flags?: ImageFlags;
|
|
122
|
+
columnCount: number;
|
|
123
|
+
rowCount: number;
|
|
124
|
+
cells: TableCell[];
|
|
125
|
+
rowHeightArr: number[];
|
|
126
|
+
columnWidthArr: number[];
|
|
127
|
+
blockRecordHandle?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Dxf block.
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export interface DxfBlock extends IBlock {
|
|
134
|
+
/**
|
|
135
|
+
* References to corresponding threejs object
|
|
136
|
+
*/
|
|
137
|
+
threejsObject?: DxfObject;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Dxf layout.
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
export interface DxfLayout extends ILayoutObject {
|
|
144
|
+
/**
|
|
145
|
+
* A collection of leaf objects directly associated with the layout, used for subsequent selection and measurement, etc.
|
|
146
|
+
* "Model" space doesn't need it for now.
|
|
147
|
+
*/
|
|
148
|
+
directAssociatedLeafObjectSet?: Set<THREE.Object3D>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Spatial filter clip polyline.
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
export interface DxfSpatialFilterClipPolyline {
|
|
155
|
+
polyline: THREE.Vector3[];
|
|
156
|
+
bConcave: boolean;
|
|
157
|
+
bReversed: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Spatial filter.
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
export interface DxfSpatialFilter extends ISpatialFilterObject {
|
|
164
|
+
/**
|
|
165
|
+
* References to corresponding threejs object
|
|
166
|
+
*/
|
|
167
|
+
threejsObject?: DxfObject;
|
|
168
|
+
localMatrix?: THREE.Matrix4;
|
|
169
|
+
clipPolylines: DxfSpatialFilterClipPolyline[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Dxf loader config.
|
|
173
|
+
* @internal
|
|
174
|
+
*/
|
|
175
|
+
export interface DxfLoaderConfig {
|
|
176
|
+
/**
|
|
177
|
+
* Ignores everything from paper space, aka, only load model space.
|
|
178
|
+
*/
|
|
179
|
+
ignorePaperSpace?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Enables caching dxf data into indexeddb.
|
|
182
|
+
*/
|
|
183
|
+
enableLocalCache?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Enables to release data after loaded in order to improve preformance.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
188
|
+
enableReleaseData?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Enables to merge objects.
|
|
191
|
+
*/
|
|
192
|
+
enableMerge?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* File encoding, can be used by dxf. Common encoding include "UTF-8", "gb2312", etc.
|
|
195
|
+
*/
|
|
196
|
+
encoding?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Apply this color to everything in this model.
|
|
199
|
+
* Color value between 0 and 1.
|
|
200
|
+
*/
|
|
201
|
+
overrideColor?: number[];
|
|
202
|
+
/**
|
|
203
|
+
* Idealy, the thickness of lines in hatch pattern should always be 1 pixel.
|
|
204
|
+
* In Viewer2d, it uses orthographic camera and always in top view,
|
|
205
|
+
* so we adjust thickness by cameraZoom (and also consider worldScale).
|
|
206
|
+
* While 3d view is more complex, it can use perspective camera,
|
|
207
|
+
* its camera position and direction is flexible. We cannot keep line thickness
|
|
208
|
+
* in a fixed pixel any more, and there is no proper way to adjust thickness as
|
|
209
|
+
* position changes. So, we need to use a fixed thickness in world coordinates.
|
|
210
|
+
*/
|
|
211
|
+
overrideHatchPatternLineThickness?: number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Dxf file loader.
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
export declare class DxfLoader extends THREE.Loader {
|
|
218
|
+
static readonly MODEL_LAYOUT_NAME = "Model";
|
|
219
|
+
static readonly SNAP_GROUP_NAME = "InvisibleObjectGroupForOSnap";
|
|
220
|
+
static readonly SHOW_SNAP_OBJECT = false;
|
|
221
|
+
private timer;
|
|
222
|
+
private ignorePaperSpace;
|
|
223
|
+
font?: FontManager;
|
|
224
|
+
private encoding;
|
|
225
|
+
private overrideColor?;
|
|
226
|
+
private overrideHatchPatternLineThickness?;
|
|
227
|
+
angBase: string | number | IPoint;
|
|
228
|
+
angDir: string | number | IPoint;
|
|
229
|
+
private header;
|
|
230
|
+
private pointsMaterials;
|
|
231
|
+
private lineBasicMaterials;
|
|
232
|
+
private lineShaderMaterials;
|
|
233
|
+
private meshBasicMaterials;
|
|
234
|
+
private meshTextureMaterials;
|
|
235
|
+
private hatchShaderMaterials;
|
|
236
|
+
private entityCount;
|
|
237
|
+
private curveCount;
|
|
238
|
+
private averageCurveSize;
|
|
239
|
+
private enableRenderOrder;
|
|
240
|
+
private enableLocalCache;
|
|
241
|
+
private enableReleaseData;
|
|
242
|
+
private enableMerge;
|
|
243
|
+
private enableRTC;
|
|
244
|
+
private enablePlineWidth;
|
|
245
|
+
private dxfDataId;
|
|
246
|
+
/**
|
|
247
|
+
* Use a context in order to easily know if it is compare mode,
|
|
248
|
+
* and, get compare result from it.
|
|
249
|
+
*/
|
|
250
|
+
private compareContext?;
|
|
251
|
+
private statsInfo;
|
|
252
|
+
private blockReferencesCache;
|
|
253
|
+
/**
|
|
254
|
+
* Adds this data member just in order to improve the performence of getLayoutName.
|
|
255
|
+
* Its key is blockrecord's handle hex string, value is its layoutHandle.
|
|
256
|
+
*/
|
|
257
|
+
private blockRecordsCache;
|
|
258
|
+
/**
|
|
259
|
+
* Adds this data member just in order to improve the performence of getLayoutName.
|
|
260
|
+
* Its key is entity's handle, value is itself.
|
|
261
|
+
*/
|
|
262
|
+
private entitiesCache;
|
|
263
|
+
/**
|
|
264
|
+
* Adds this data member just in order to improve the performence of getBlockByHandle.
|
|
265
|
+
* Its key is block's ownerHandle, value is IBlock.
|
|
266
|
+
*/
|
|
267
|
+
private blocksCache;
|
|
268
|
+
/**
|
|
269
|
+
* Adds this in order to improve performance of findSpatialFilterByHandle.
|
|
270
|
+
* Key is dictionaryObject's ownerHandle(entity's handle), value is spatial filter's ownerHandle
|
|
271
|
+
*/
|
|
272
|
+
private dictionaryOwnerHandleAndSpatialFilterHandlesCache;
|
|
273
|
+
/**
|
|
274
|
+
* Adds this in order to improve performance of findSpatialFilterByHandle.
|
|
275
|
+
* Key is ISpatialFilterObject's ownerHandle, value is ISpatialFilterObject
|
|
276
|
+
*/
|
|
277
|
+
private spatialFiltersCache;
|
|
278
|
+
/**
|
|
279
|
+
* Adds this in order to improve performance of creating threejs object
|
|
280
|
+
* Key is entity's handle, value is threejs object.
|
|
281
|
+
*/
|
|
282
|
+
private entityThreejsCache;
|
|
283
|
+
private entityTypesAndTimes;
|
|
284
|
+
private nonSnapableTypes;
|
|
285
|
+
private layoutsSnapObjectsMap;
|
|
286
|
+
/**
|
|
287
|
+
* A flag to abort loading any dxf files, it aborts dxf compare progress too.
|
|
288
|
+
* It doesn't support to abort one of the loader for now.
|
|
289
|
+
*/
|
|
290
|
+
private aborted;
|
|
291
|
+
static CameraZoomUniform: {
|
|
292
|
+
value: number;
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Used for drawing dashed lines properly in a viewport.
|
|
296
|
+
*/
|
|
297
|
+
static ViewportScaleUniform: {
|
|
298
|
+
value: number;
|
|
299
|
+
};
|
|
300
|
+
static TransformMatrixUniform: {
|
|
301
|
+
value: THREE.Matrix4;
|
|
302
|
+
};
|
|
303
|
+
static ResolutionUniform: {
|
|
304
|
+
value: THREE.Vector2;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* WebGL has a limited capability for FragmentUniforms. Thus, cannot have as many
|
|
308
|
+
* clippingPlanes as expected.
|
|
309
|
+
*/
|
|
310
|
+
static MaxFragmentUniforms: number;
|
|
311
|
+
/**
|
|
312
|
+
* DxfLoader constructor
|
|
313
|
+
*/
|
|
314
|
+
constructor(manager?: THREE.LoadingManager, cfg?: DxfLoaderConfig);
|
|
315
|
+
/**
|
|
316
|
+
* Sets font.
|
|
317
|
+
*/
|
|
318
|
+
setFont(font: FontManager): void;
|
|
319
|
+
/**
|
|
320
|
+
* Downloads dxf file content
|
|
321
|
+
*/
|
|
322
|
+
private download;
|
|
323
|
+
/**
|
|
324
|
+
* Loads a dxf file by given url.
|
|
325
|
+
* If dxfDataId is specified and local cache is enabled, it firstly tries to load from cache.
|
|
326
|
+
* @param url url of the dxf file
|
|
327
|
+
* @param dxfDataId target dxf data id, used to get dxf data from cache if local cache is enabled.
|
|
328
|
+
* @param onProgress on progress callback
|
|
329
|
+
* @returns DxfData
|
|
330
|
+
*/
|
|
331
|
+
loadAsyncEx(url: string, dxfDataId?: string, onProgress?: (event: ProgressEvent) => void): Promise<DxfData>;
|
|
332
|
+
/**
|
|
333
|
+
* Loads dxf asynchronously. It mainly contains 2 steps:
|
|
334
|
+
* 1. Parses file content
|
|
335
|
+
* 2. Generates/load threejs objects
|
|
336
|
+
* @param url url of the dxf file
|
|
337
|
+
* @param onProgress on progress callback
|
|
338
|
+
*/
|
|
339
|
+
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<DxfData>;
|
|
340
|
+
/**
|
|
341
|
+
* Parses dxf contents from given url.
|
|
342
|
+
*/
|
|
343
|
+
parse(url: string, onProgress?: (event: ProgressEvent) => void): Promise<IDxf>;
|
|
344
|
+
/**
|
|
345
|
+
* Aborts loading or parsing progress if any.
|
|
346
|
+
* We cann't resume any progress once aborted.
|
|
347
|
+
* TODO: the abort logic is not well tested yet, need to be verified.
|
|
348
|
+
*/
|
|
349
|
+
abort(): this;
|
|
350
|
+
/**
|
|
351
|
+
* If loading or parsing progress is aborted.
|
|
352
|
+
*/
|
|
353
|
+
isAborted(): boolean;
|
|
354
|
+
private parseHeader;
|
|
355
|
+
/**
|
|
356
|
+
* For some versions, the dxf file may be wired, missing header, objects, tables, etc.
|
|
357
|
+
* We'll try to fill in missing content for it.
|
|
358
|
+
*/
|
|
359
|
+
private tryFixDxfData;
|
|
360
|
+
/**
|
|
361
|
+
* Generates/load threejs objects according to the dxf data.
|
|
362
|
+
* @param data
|
|
363
|
+
* @param onProgress
|
|
364
|
+
* @returns the promise of DxfData
|
|
365
|
+
*/
|
|
366
|
+
loadEntities(data: IDxf, onProgress?: (event: ProgressEvent) => void): Promise<DxfData>;
|
|
367
|
+
private getFontFilesFromDxf;
|
|
368
|
+
/**
|
|
369
|
+
* Loads entities from two dxf data for comparing.
|
|
370
|
+
* It also generates DxfChange information for each change.
|
|
371
|
+
*/
|
|
372
|
+
loadEntitiesForCompare(data1: IDxf, data2: IDxf, changes: Record<string, DxfChange>, bIgnoreSameEntity?: boolean, onProgress?: (event: ProgressEvent) => void): Promise<void>;
|
|
373
|
+
private setObjectColorByChange;
|
|
374
|
+
/**
|
|
375
|
+
* Manually release some objects to save memory.
|
|
376
|
+
*/
|
|
377
|
+
private releaseCachedData;
|
|
378
|
+
/**
|
|
379
|
+
* Releases memory-costy elements of an entity
|
|
380
|
+
*/
|
|
381
|
+
private releaseEntity;
|
|
382
|
+
/**
|
|
383
|
+
* Releases memory-costy elements of dxf data
|
|
384
|
+
*/
|
|
385
|
+
private releaseDxfData;
|
|
386
|
+
/**
|
|
387
|
+
* We'll need to pass in the blockEntity when loadEntity is called from a block.
|
|
388
|
+
* So that, when an entity's color is ByLayer, and its layer is "0", it should use block's layer,
|
|
389
|
+
* rather than the layer of the entity itself!
|
|
390
|
+
* We don't know if there is other similar case in future, so pass in blockEntity here.
|
|
391
|
+
*/
|
|
392
|
+
loadEntity(entity: DxfEntity, data: IDxf, parentEntity?: IEntity, isParentChanged?: boolean): DxfObject | undefined;
|
|
393
|
+
private loadEllipse;
|
|
394
|
+
private loadMText;
|
|
395
|
+
private getMTextGroup;
|
|
396
|
+
private mtextContentAndFormattingToTextAndStyle;
|
|
397
|
+
private getTextLineNum;
|
|
398
|
+
private load3DFace;
|
|
399
|
+
private loadSpline;
|
|
400
|
+
private loadXLine;
|
|
401
|
+
private loadRay;
|
|
402
|
+
private loadLine;
|
|
403
|
+
private loadLWPolyline;
|
|
404
|
+
private loadMLeader;
|
|
405
|
+
private loadLeader;
|
|
406
|
+
private getTableTextOffset;
|
|
407
|
+
private loadTable;
|
|
408
|
+
private loadDefaultLeadArrow;
|
|
409
|
+
private getBlockByHandle;
|
|
410
|
+
static updateMaterialUniforms(material: THREE.Material): void;
|
|
411
|
+
static transformAngleByOcsMatrix(ocsMatrix: THREE.Matrix4, angle: number): number;
|
|
412
|
+
static getArcAnglesByOcsMatrix(ocsMatrix: THREE.Matrix4, startAngle: number, endAngle: number): number[];
|
|
413
|
+
private loadArc;
|
|
414
|
+
private addTriangleFacingCamera;
|
|
415
|
+
private loadSolid;
|
|
416
|
+
private getTextStyle;
|
|
417
|
+
private getDefaultDimensionStyle;
|
|
418
|
+
private getTextEncoding;
|
|
419
|
+
private getTextMesh;
|
|
420
|
+
private createTextMeshByText;
|
|
421
|
+
private transformTextMesh;
|
|
422
|
+
private loadText;
|
|
423
|
+
private loadAttDef;
|
|
424
|
+
private loadAttrib;
|
|
425
|
+
private loadPoint;
|
|
426
|
+
private loadDimension;
|
|
427
|
+
private loadImage;
|
|
428
|
+
private loadInsert;
|
|
429
|
+
private loadSpatialFilter;
|
|
430
|
+
private loadLayout;
|
|
431
|
+
private convertEdgeToPoints;
|
|
432
|
+
private loadHatch;
|
|
433
|
+
private loadOle2frame;
|
|
434
|
+
private static getOcsMatrix;
|
|
435
|
+
static getDcs2WcsMatrix(viewportEntity: IViewportEntity | IViewport, angDir: number): THREE.Matrix4;
|
|
436
|
+
private getViewportMsToPsMatrix;
|
|
437
|
+
private loadViewport;
|
|
438
|
+
/**
|
|
439
|
+
* Common function to create a DxfObject of line type
|
|
440
|
+
*/
|
|
441
|
+
private createLineObjectFromPoints;
|
|
442
|
+
private getColor;
|
|
443
|
+
private getLineType;
|
|
444
|
+
/**
|
|
445
|
+
* Gets entity's layer name.
|
|
446
|
+
* Note that, when entity is in layer "0", it tries to get its parent blockEntity's layer name.
|
|
447
|
+
*/
|
|
448
|
+
private getLayerName;
|
|
449
|
+
/**
|
|
450
|
+
* Sets object's material after being created
|
|
451
|
+
* TODO: hatch is handled separately, and may move its logic here.
|
|
452
|
+
*/
|
|
453
|
+
private setMaterial;
|
|
454
|
+
private setHatchMaterial;
|
|
455
|
+
private setRenderOrderByObjectType;
|
|
456
|
+
private getPointsMaterial;
|
|
457
|
+
private getLineBasicMaterial;
|
|
458
|
+
private getLineShaderMaterial;
|
|
459
|
+
private getMeshBasicMaterial;
|
|
460
|
+
/**
|
|
461
|
+
* Gets shader material for drawing a hatch with pattern
|
|
462
|
+
*/
|
|
463
|
+
private getHatchShaderMaterial;
|
|
464
|
+
/**
|
|
465
|
+
* Gets a proper division for curve by entity count, entity size and theta angle, etc.
|
|
466
|
+
* @param size may not be accurate, can be the radius, long size of bbox, etc.
|
|
467
|
+
*/
|
|
468
|
+
private getDivision;
|
|
469
|
+
/**
|
|
470
|
+
* Gets a proper interpolation for bspline.
|
|
471
|
+
* A bigger interpolation value generates smooth bspline, but with a bad performance, so we need to limit this value.
|
|
472
|
+
* @param pointCount control point count
|
|
473
|
+
* @param size may not be accurate, can be the long side of bbox, etc.
|
|
474
|
+
*/
|
|
475
|
+
getBSplineInterpolationsPerSplineSegment(pointCount: number, size: number): number;
|
|
476
|
+
/**
|
|
477
|
+
* Gets proper simplify tolerance.
|
|
478
|
+
* If tolerance is bigger, more points are simpified.
|
|
479
|
+
*/
|
|
480
|
+
/**
|
|
481
|
+
* Catches dxf data into indexedDb
|
|
482
|
+
*/
|
|
483
|
+
private setDxfDataToIndexedDb;
|
|
484
|
+
/**
|
|
485
|
+
* Gets dxf data into indexedDb
|
|
486
|
+
*/
|
|
487
|
+
private getDxfDataFromIndexedDb;
|
|
488
|
+
private buildContainHierarchyTree;
|
|
489
|
+
private buildHatchGeometry;
|
|
490
|
+
private findIntersectHole;
|
|
491
|
+
/**
|
|
492
|
+
* Checks if we should rebase points in case their values are big, and do rebase if necessary
|
|
493
|
+
*/
|
|
494
|
+
private checkAndRebasePolygonsOnRTC;
|
|
495
|
+
/**
|
|
496
|
+
* Adds "relativeToCenter" flag to indicate an object has been rebased
|
|
497
|
+
*/
|
|
498
|
+
private setRTCUserData;
|
|
499
|
+
private IsfilteredByPathTypeFlag;
|
|
500
|
+
/**
|
|
501
|
+
* Finds spatial filter by entity handle.
|
|
502
|
+
*/
|
|
503
|
+
private findSpatialFilterByHandle;
|
|
504
|
+
private entityHandlesWithRenderOrder;
|
|
505
|
+
/**
|
|
506
|
+
* Find out render order info from SortEntsTable.
|
|
507
|
+
*/
|
|
508
|
+
private initRenderOrderInfo;
|
|
509
|
+
private findMatchedHatchShaderMaterial;
|
|
510
|
+
/**
|
|
511
|
+
* Adds entity to layoutViewportsMap if it is a viewport entity.
|
|
512
|
+
*/
|
|
513
|
+
private checkAndAddToViewportMap;
|
|
514
|
+
/**
|
|
515
|
+
* Gets the layout that entity belongs to.
|
|
516
|
+
* Entities resident in two places:
|
|
517
|
+
* 1) IDxf.entities
|
|
518
|
+
* 2) IDxf.blocks[<blockName>].entities
|
|
519
|
+
*/
|
|
520
|
+
private getLayout;
|
|
521
|
+
private getLayerVisible;
|
|
522
|
+
private getLayerFrozen;
|
|
523
|
+
private cloneMaterialsForSpatialFilter;
|
|
524
|
+
private getLineTypeScales;
|
|
525
|
+
static getDxfUnits(unitValue: number): Units;
|
|
526
|
+
/**
|
|
527
|
+
* Calculates line distances for given line in world space.
|
|
528
|
+
*/
|
|
529
|
+
static computeLineDistance(line: THREE.Line): void;
|
|
530
|
+
/**
|
|
531
|
+
* Calculates line distances for all lines of an object in world space.
|
|
532
|
+
* We need to call this before rendering dashed lines (before calling createLineShaderMaterial).
|
|
533
|
+
*/
|
|
534
|
+
static computeLineDistances(object: THREE.Object3D): void;
|
|
535
|
+
private static mergeDxfObjects;
|
|
536
|
+
/**
|
|
537
|
+
* Merges objects by layer and layout.
|
|
538
|
+
*/
|
|
539
|
+
static merge(dxfData: DxfData, onProgress?: (event: ProgressEvent) => void): Promise<void>;
|
|
540
|
+
/**
|
|
541
|
+
* Prints stats info for debugging
|
|
542
|
+
*/
|
|
543
|
+
private printStatsInfo;
|
|
544
|
+
private static statLayoutAndLayerObjects;
|
|
545
|
+
/**
|
|
546
|
+
* First marks the objects to be removed from bottom to top,
|
|
547
|
+
* and then removes empty objects from top to bottom
|
|
548
|
+
*/
|
|
549
|
+
private static removeEmptyObjectsFromRemovingMarkedObjects;
|
|
550
|
+
private static removeEmptyObjectsFromMark;
|
|
551
|
+
/**
|
|
552
|
+
* First marks the objects to be removed from bottom to top,
|
|
553
|
+
* and then removes empty objects from top to bottom
|
|
554
|
+
*/
|
|
555
|
+
private static removeEmptyObjectsFromRemovingMarkedObjects2;
|
|
556
|
+
private static removeEmptyObjectsFromMark2;
|
|
557
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Box3, BufferGeometry, Object3D, Layers, Material, Matrix4 } from "three";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
export declare enum ObjectType {
|
|
4
|
+
Object = 0,
|
|
5
|
+
Point = 1,
|
|
6
|
+
Line = 2,
|
|
7
|
+
LineSegment = 3,
|
|
8
|
+
Mesh = 4
|
|
9
|
+
}
|
|
10
|
+
export type CallBack = (object: DxfObject) => void;
|
|
11
|
+
export declare class DxfObject {
|
|
12
|
+
name: string;
|
|
13
|
+
type: ObjectType;
|
|
14
|
+
matrix: Matrix4;
|
|
15
|
+
parent?: DxfObject;
|
|
16
|
+
children: DxfObject[];
|
|
17
|
+
layers: Layers;
|
|
18
|
+
renderOrder: number;
|
|
19
|
+
userData: any;
|
|
20
|
+
material?: Material;
|
|
21
|
+
geometry?: BufferGeometry;
|
|
22
|
+
matrixWorld?: Matrix4;
|
|
23
|
+
constructor(type?: ObjectType);
|
|
24
|
+
add(object: DxfObject, ...args: DxfObject[]): this;
|
|
25
|
+
remove(object: DxfObject, ...args: DxfObject[]): this;
|
|
26
|
+
removeFromParent(): this;
|
|
27
|
+
clear(): this;
|
|
28
|
+
traverse(callback: CallBack): void;
|
|
29
|
+
clone(recursive?: boolean): DxfObject;
|
|
30
|
+
copy(source: DxfObject, recursive?: boolean): this;
|
|
31
|
+
convertToThreejsObject(recursive?: boolean): Object3D<THREE.Object3DEventMap> | undefined;
|
|
32
|
+
static getBox(object: DxfObject, box: THREE.Box3, parentMatrix?: Matrix4): Box3;
|
|
33
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
/**
|
|
16
|
+
* Merges child objects for given object.
|
|
17
|
+
* it tries to merge objects in the same level and with the same parent;
|
|
18
|
+
* @param saveBatchInfo caller can set saveBatchInfo to true, so that s/he can
|
|
19
|
+
* get the object's original data before merged.
|
|
20
|
+
* While this takes some extra space, so, we'd like to add a flag here.
|
|
21
|
+
*/
|
|
22
|
+
static merge(object: DxfObject, saveBatchInfo?: boolean): void;
|
|
23
|
+
/**
|
|
24
|
+
* Merges child objects of given object.
|
|
25
|
+
* If objects' material are the same, they can be merged.
|
|
26
|
+
*/
|
|
27
|
+
private static mergeInner;
|
|
28
|
+
/**
|
|
29
|
+
* Merges all objects of given object, just leaf children.
|
|
30
|
+
* If objects' material are the same, they can be merged.
|
|
31
|
+
* Better to call mergeInner first then deepMerge for a better performance.
|
|
32
|
+
* return \{ "added": THREE.Object3D[], "removed": THREE.Object3D[] \}
|
|
33
|
+
*/
|
|
34
|
+
static deepMerge(objects: DxfObject[], levelObject?: DxfObject | undefined, bRemovedAndAddedAfterMerge?: boolean, bRemoveEmptyObjectsAfterMerge?: boolean, saveBatchInfo?: boolean): {
|
|
35
|
+
added: DxfObject[];
|
|
36
|
+
removed: DxfObject[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Merges geometries for lines
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Removes a number from array
|
|
43
|
+
*/
|
|
44
|
+
private static removeFromArray;
|
|
45
|
+
}
|
|
@@ -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,7 @@
|
|
|
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
|
+
export declare const bspline: (t: number, degree: number, points: number[][], knots: number[], weights?: number[]) => number[];
|