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,14 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export declare class EdgeUtils {
|
|
3
|
+
/**
|
|
4
|
+
* reference to buildEdgeIndices from xeokit
|
|
5
|
+
*/
|
|
6
|
+
static buildEdge(positions: Float32Array, indices: Uint32Array | Uint16Array | Uint8Array, edgeThreshold?: number): Uint32Array | Uint16Array;
|
|
7
|
+
/**
|
|
8
|
+
* Calculate the barycentric coordinates of each vertex of the geometry
|
|
9
|
+
* TODO: Temporarily do not handle the following cases.
|
|
10
|
+
* - When there is no solution, it is necessary to expand the vertices
|
|
11
|
+
* The algorithm also has performance issues !
|
|
12
|
+
*/
|
|
13
|
+
static buildBarycentrics(geometry: THREE.BufferGeometry): boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare type Handler<T = any> = (val: T) => void;
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class Event<Events extends Record<string, any> = {}> {
|
|
6
|
+
private map;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
addEventListener<EventName extends keyof Events>(name: EventName, handler: Handler<Events[EventName]>): void;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
dispatchEvent<EventName extends keyof Events>(name: EventName, value?: Events[EventName]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if there is a listener
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
hasEventListener<EventName extends keyof Events>(name: EventName): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Removes all event listeners
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
removeEventListener(): void;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
removeEventListener<EventName extends keyof Events>(name: EventName): void;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
removeEventListener<EventName extends keyof Events>(name: EventName, handler: Handler<Events[EventName]>): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface ILine {
|
|
6
|
+
start: THREE.Vector3;
|
|
7
|
+
end: THREE.Vector3;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* GeometryUtils 类
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class GeometryUtils {
|
|
14
|
+
/**
|
|
15
|
+
* 比较两个几何体
|
|
16
|
+
*/
|
|
17
|
+
static geometryEquals(g1: THREE.BufferGeometry, g2: THREE.BufferGeometry): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 检查两个类型是否相等。
|
|
20
|
+
* 此方法要求类型 T 定义了 'equals' 方法。
|
|
21
|
+
*/
|
|
22
|
+
private static equals;
|
|
23
|
+
private static attributesEqual;
|
|
24
|
+
private static bufferAttributeEqual;
|
|
25
|
+
/**
|
|
26
|
+
* 将 InterleavedBufferAttribute 转换为 BufferAttribute,因为 mergeGeometries 不支持 InterleavedBufferAttribute。
|
|
27
|
+
* 如果将来 Three.js 支持了,我们应该移除此方法。
|
|
28
|
+
*/
|
|
29
|
+
static tryConvertInterleavedBufferAttributes(geometry: THREE.BufferGeometry): void;
|
|
30
|
+
/**
|
|
31
|
+
* 判断 2D 点是否在多边形内部
|
|
32
|
+
*/
|
|
33
|
+
static isPointInPolygon(point: THREE.Vector2, polygon: THREE.Vector2[], includeOnSide?: boolean): boolean;
|
|
34
|
+
static caculateGeometryCenter(geometry: THREE.BufferGeometry): THREE.Vector3 | null;
|
|
35
|
+
static isConvex(polygon: THREE.Vector2[]): boolean;
|
|
36
|
+
static areLineSegmentsIntersecting(line1: ILine, line2: ILine): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 尝试获取两条线段的交点。
|
|
39
|
+
* 如果两条线段不相交,则返回 undefined。
|
|
40
|
+
*/
|
|
41
|
+
static getLineSegmentsIntersectingPoint(line1: ILine, line2: ILine): THREE.Vector3 | null | undefined;
|
|
42
|
+
static isPointOnLineSegment(point: THREE.Vector3, line: ILine, epsilon?: number): boolean;
|
|
43
|
+
static isPointOnLineSegments(point: THREE.Vector3, lines: THREE.Vector3[], epsilon?: number): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 检查当点的值过大时是否需要重设基点,并在必要时进行重设
|
|
46
|
+
*/
|
|
47
|
+
static checkAndRebasePositionsOnRTC(positions: THREE.Vector3[] | THREE.Vector2[], offset: THREE.Vector3): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* 检查当点的值过大时是否需要重设基点
|
|
50
|
+
*/
|
|
51
|
+
static shouldRebasePositionOnRTC(vector: THREE.Vector3 | THREE.Vector2): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 计算表面积
|
|
54
|
+
*/
|
|
55
|
+
static calculateSurfaceArea(geometry: THREE.BufferGeometry): number;
|
|
56
|
+
/**
|
|
57
|
+
* 将 line_strip 类型的索引转换为 line
|
|
58
|
+
* 用于合并
|
|
59
|
+
*/
|
|
60
|
+
static convertLineStripToLine(geometry: THREE.BufferGeometry, bLoop?: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* 将索引几何体转换为非索引几何体。可用于虚线样式。
|
|
63
|
+
*/
|
|
64
|
+
static convertGeometryWithIndexedToNonIndexed(geometry: THREE.BufferGeometry): THREE.BufferGeometry;
|
|
65
|
+
static createGeometryAttributeByIndex(attribute: THREE.BufferAttribute, indexBuffer: THREE.BufferAttribute): THREE.BufferAttribute;
|
|
66
|
+
/**
|
|
67
|
+
* 根据给定索引获取线段的起点/终点
|
|
68
|
+
*/
|
|
69
|
+
static getLineEndPointsByIndex(line: THREE.Line, index: number): THREE.Vector3[];
|
|
70
|
+
static arePolygonsIntersect(polygon1: THREE.Vector2[], polygon2: THREE.Vector2[]): boolean;
|
|
71
|
+
static getLineLineIntersectionPoint(a: THREE.Vector2, b: THREE.Vector2, c: THREE.Vector2, d: THREE.Vector2, epsilon?: number): THREE.Vector2 | undefined;
|
|
72
|
+
static getOffsetPoint(a: THREE.Vector2, b: THREE.Vector2, offset: number): THREE.Vector2;
|
|
73
|
+
static convertSimpleWidthLineToMeshGeometry(points: THREE.Vector2[], width: number): THREE.BufferGeometry<THREE.NormalBufferAttributes> | undefined;
|
|
74
|
+
static convertWidthLineToMeshGeometry(points: THREE.Vector2[], width: number): THREE.BufferGeometry<THREE.NormalBufferAttributes> | undefined;
|
|
75
|
+
static releaseGeometryManually(geometry: THREE.BufferGeometry): void;
|
|
76
|
+
static getAdjacentNonRepeatPoints(points: THREE.Vector3[], epsilon?: number): THREE.Vector3[];
|
|
77
|
+
static mergeBBoxes(bboxes: THREE.Box3[]): THREE.Box3[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 精确判断点是否在多边形内部(射线投射算法)
|
|
81
|
+
*
|
|
82
|
+
* 算法原理:
|
|
83
|
+
* 1. 从测试点向右发射一条水平射线
|
|
84
|
+
* 2. 统计射线与多边形边的交点数量
|
|
85
|
+
* 3. 奇数次交点 = 点在多边形内部,偶数次 = 外部
|
|
86
|
+
*
|
|
87
|
+
* @param point - 测试点 (THREE.Vector2)
|
|
88
|
+
* @param polygon - 多边形顶点数组
|
|
89
|
+
* @returns true 如果点在多边形内部(含边界)
|
|
90
|
+
*/
|
|
91
|
+
export declare function isPointInPolygonPrecise(point: THREE.Vector2, polygon: THREE.Vector2[]): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* 判断点是否在线段上
|
|
94
|
+
*/
|
|
95
|
+
export declare function isPointOnLineSegment(point: THREE.Vector2, start: THREE.Vector2, end: THREE.Vector2, tolerance: number): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* 精确的多边形面积计算 (Shoelace公式)
|
|
98
|
+
*/
|
|
99
|
+
export declare function calculatePolygonAreaPrecise(points: THREE.Vector3[]): number;
|
|
100
|
+
/**
|
|
101
|
+
* 判断点是否在轴对齐矩形内部(包含边界)
|
|
102
|
+
*/
|
|
103
|
+
export declare function isPointInRect(p: THREE.Vector3, min: THREE.Vector3, max: THREE.Vector3): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 通用的闭环重建逻辑(半边遍历)
|
|
106
|
+
*/
|
|
107
|
+
export declare function rebuildClosedLoops(segments: Array<[THREE.Vector3, THREE.Vector3]>): THREE.Vector3[][] | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* 从 Mesh 重建闭环多边形(世界坐标)
|
|
110
|
+
*/
|
|
111
|
+
export declare function extractClosedPolygonsFromMesh(mesh: THREE.Mesh): THREE.Vector3[][] | undefined;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export declare const en: {
|
|
2
|
+
NavCube: {
|
|
3
|
+
front: string;
|
|
4
|
+
back: string;
|
|
5
|
+
top: string;
|
|
6
|
+
bottom: string;
|
|
7
|
+
left: string;
|
|
8
|
+
right: string;
|
|
9
|
+
};
|
|
10
|
+
ContextMenu: {
|
|
11
|
+
viewFitAll: string;
|
|
12
|
+
hideAll: string;
|
|
13
|
+
showAll: string;
|
|
14
|
+
xRayAll: string;
|
|
15
|
+
xRayNone: string;
|
|
16
|
+
selectNone: string;
|
|
17
|
+
resetView: string;
|
|
18
|
+
viewFitEntity: string;
|
|
19
|
+
hideEntity: string;
|
|
20
|
+
hideOthers: string;
|
|
21
|
+
xRayEntity: string;
|
|
22
|
+
xRayOthers: string;
|
|
23
|
+
select: string;
|
|
24
|
+
deselect: string;
|
|
25
|
+
showSectionPlane: string;
|
|
26
|
+
showSectionBox: string;
|
|
27
|
+
showAxisSection: string;
|
|
28
|
+
hideSectionPlane: string;
|
|
29
|
+
hideSectionBox: string;
|
|
30
|
+
hideAxisSection: string;
|
|
31
|
+
undoSection: string;
|
|
32
|
+
};
|
|
33
|
+
ProgressBar: {
|
|
34
|
+
Loading: string;
|
|
35
|
+
Comparing: string;
|
|
36
|
+
};
|
|
37
|
+
Toolbar: {
|
|
38
|
+
homeView: string;
|
|
39
|
+
orthoView: string;
|
|
40
|
+
measurement: string;
|
|
41
|
+
distanceMeasurement: string;
|
|
42
|
+
areaMeasurement: string;
|
|
43
|
+
angleMeasurement: string;
|
|
44
|
+
coordinateMeasurement: string;
|
|
45
|
+
clearMeasurement: string;
|
|
46
|
+
markupVisibility: string;
|
|
47
|
+
markup: string;
|
|
48
|
+
markupArrow: string;
|
|
49
|
+
markupRect: string;
|
|
50
|
+
markupCloudRect: string;
|
|
51
|
+
markupPolyLine: string;
|
|
52
|
+
markupCloudLine: string;
|
|
53
|
+
markupEllipse: string;
|
|
54
|
+
markupCircle: string;
|
|
55
|
+
markupDot: string;
|
|
56
|
+
markupText: string;
|
|
57
|
+
markupX: string;
|
|
58
|
+
markupStroke: string;
|
|
59
|
+
markupLineWidth: string;
|
|
60
|
+
markupLineWidth2: string;
|
|
61
|
+
markupLineWidth5: string;
|
|
62
|
+
markupLineWidth10: string;
|
|
63
|
+
markupFontSize: string;
|
|
64
|
+
markupFontSize14: string;
|
|
65
|
+
markupFontSize18: string;
|
|
66
|
+
markupFontSize24: string;
|
|
67
|
+
clearMarkup: string;
|
|
68
|
+
quitMarkup: string;
|
|
69
|
+
section: string;
|
|
70
|
+
axisSection: string;
|
|
71
|
+
pickSectionPlane: string;
|
|
72
|
+
sectionBox: string;
|
|
73
|
+
bimTree: string;
|
|
74
|
+
viewpoint: string;
|
|
75
|
+
annotation: string;
|
|
76
|
+
property: string;
|
|
77
|
+
settings: string;
|
|
78
|
+
compared: string;
|
|
79
|
+
quitCompare: string;
|
|
80
|
+
fullscreen: string;
|
|
81
|
+
layers: string;
|
|
82
|
+
zoomToRectangle: string;
|
|
83
|
+
screenshot: string;
|
|
84
|
+
};
|
|
85
|
+
Tooltip: {
|
|
86
|
+
measure: string;
|
|
87
|
+
areaMeasurement: string;
|
|
88
|
+
section: string;
|
|
89
|
+
boxSelect: string;
|
|
90
|
+
pickMarkup: string;
|
|
91
|
+
};
|
|
92
|
+
PopPanel: {
|
|
93
|
+
reset: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export declare const cn: {
|
|
97
|
+
NavCube: {
|
|
98
|
+
front: string;
|
|
99
|
+
back: string;
|
|
100
|
+
top: string;
|
|
101
|
+
bottom: string;
|
|
102
|
+
left: string;
|
|
103
|
+
right: string;
|
|
104
|
+
};
|
|
105
|
+
ContextMenu: {
|
|
106
|
+
viewFitAll: string;
|
|
107
|
+
hideAll: string;
|
|
108
|
+
showAll: string;
|
|
109
|
+
xRayAll: string;
|
|
110
|
+
xRayNone: string;
|
|
111
|
+
selectNone: string;
|
|
112
|
+
resetView: string;
|
|
113
|
+
viewFitEntity: string;
|
|
114
|
+
hideEntity: string;
|
|
115
|
+
hideOthers: string;
|
|
116
|
+
xRayEntity: string;
|
|
117
|
+
xRayOthers: string;
|
|
118
|
+
select: string;
|
|
119
|
+
deselect: string;
|
|
120
|
+
showSectionPlane: string;
|
|
121
|
+
showSectionBox: string;
|
|
122
|
+
showAxisSection: string;
|
|
123
|
+
hideSectionPlane: string;
|
|
124
|
+
hideSectionBox: string;
|
|
125
|
+
hideAxisSection: string;
|
|
126
|
+
undoSection: string;
|
|
127
|
+
};
|
|
128
|
+
ProgressBar: {
|
|
129
|
+
Loading: string;
|
|
130
|
+
Comparing: string;
|
|
131
|
+
};
|
|
132
|
+
Toolbar: {
|
|
133
|
+
homeView: string;
|
|
134
|
+
orthoView: string;
|
|
135
|
+
measurement: string;
|
|
136
|
+
distanceMeasurement: string;
|
|
137
|
+
areaMeasurement: string;
|
|
138
|
+
angleMeasurement: string;
|
|
139
|
+
coordinateMeasurement: string;
|
|
140
|
+
clearMeasurement: string;
|
|
141
|
+
markupVisibility: string;
|
|
142
|
+
markup: string;
|
|
143
|
+
markupArrow: string;
|
|
144
|
+
markupRect: string;
|
|
145
|
+
markupCloudRect: string;
|
|
146
|
+
markupPolyLine: string;
|
|
147
|
+
markupCloudLine: string;
|
|
148
|
+
markupEllipse: string;
|
|
149
|
+
markupCircle: string;
|
|
150
|
+
markupDot: string;
|
|
151
|
+
markupText: string;
|
|
152
|
+
markupX: string;
|
|
153
|
+
markupStroke: string;
|
|
154
|
+
markupLineWidth: string;
|
|
155
|
+
markupLineWidth2: string;
|
|
156
|
+
markupLineWidth5: string;
|
|
157
|
+
markupLineWidth10: string;
|
|
158
|
+
markupFontSize: string;
|
|
159
|
+
markupFontSize14: string;
|
|
160
|
+
markupFontSize18: string;
|
|
161
|
+
markupFontSize24: string;
|
|
162
|
+
clearMarkup: string;
|
|
163
|
+
quitMarkup: string;
|
|
164
|
+
section: string;
|
|
165
|
+
axisSection: string;
|
|
166
|
+
pickSectionPlane: string;
|
|
167
|
+
sectionBox: string;
|
|
168
|
+
bimTree: string;
|
|
169
|
+
viewpoint: string;
|
|
170
|
+
annotation: string;
|
|
171
|
+
property: string;
|
|
172
|
+
settings: string;
|
|
173
|
+
compared: string;
|
|
174
|
+
quitCompare: string;
|
|
175
|
+
fullscreen: string;
|
|
176
|
+
layers: string;
|
|
177
|
+
zoomToRectangle: string;
|
|
178
|
+
screenshot: string;
|
|
179
|
+
};
|
|
180
|
+
Tooltip: {
|
|
181
|
+
measure: string;
|
|
182
|
+
areaMeasurement: string;
|
|
183
|
+
section: string;
|
|
184
|
+
boxSelect: string;
|
|
185
|
+
pickMarkup: string;
|
|
186
|
+
};
|
|
187
|
+
PopPanel: {
|
|
188
|
+
reset: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* MaterialUtils class
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class MaterialUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Compares two materials
|
|
9
|
+
*/
|
|
10
|
+
static materialEquals(m1: THREE.Material, m2: THREE.Material): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Compares two materials, which could be material or material array
|
|
13
|
+
*/
|
|
14
|
+
static materialsEquals(m1: THREE.Material | THREE.Material[], m2: THREE.Material | THREE.Material[]): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Compares two colors
|
|
17
|
+
*/
|
|
18
|
+
static colorEquals(c1: THREE.Color, c2: THREE.Color): boolean;
|
|
19
|
+
static clonedHighlightMaterials(mesh: THREE.Mesh | THREE.Line | THREE.Points, options?: {
|
|
20
|
+
depthTest?: boolean;
|
|
21
|
+
highlightColor?: THREE.Color;
|
|
22
|
+
opacity?: number;
|
|
23
|
+
}): THREE.Material | THREE.Material[] | undefined;
|
|
24
|
+
static clonedHighlightMaterial(material: THREE.Material, options?: {
|
|
25
|
+
depthTest?: boolean;
|
|
26
|
+
highlightColor?: THREE.Color;
|
|
27
|
+
opacity?: number;
|
|
28
|
+
}): THREE.Material;
|
|
29
|
+
/**
|
|
30
|
+
* Clone given material(s)
|
|
31
|
+
*/
|
|
32
|
+
static cloneMaterial(material: THREE.Material | THREE.Material[]): THREE.Material | THREE.Material[];
|
|
33
|
+
static getMaterialColor(material: THREE.Material | THREE.Material[]): THREE.Color;
|
|
34
|
+
static setMaterialColor(material: THREE.Material | THREE.Material[], color: THREE.Color): void;
|
|
35
|
+
static setMaterialOpacity(material: THREE.Material | THREE.Material[], opacity: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clone object's materials
|
|
38
|
+
*/
|
|
39
|
+
static cloneMaterials(object: THREE.Object3D): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { Vector3, Box, Mat4 } from "../../core/Constants";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class MathUtils {
|
|
7
|
+
static roundNumber(value: number, n: number): number;
|
|
8
|
+
static floorNumber(value: number, n: number): number;
|
|
9
|
+
static areNumbersEqual(a: number, b: number, epsilon?: number): boolean;
|
|
10
|
+
static areVector2sEqual(a: THREE.Vector2, b: THREE.Vector2, epsilon?: number): boolean;
|
|
11
|
+
static areVector3sEqual(a: THREE.Vector3, b: THREE.Vector3, epsilon?: number): boolean;
|
|
12
|
+
static areNumbersClose(a: number, b: number, ref_tol?: number, abs_tol?: number): boolean;
|
|
13
|
+
static areVector2sClose(point1: THREE.Vector2, point2: THREE.Vector2, ref_tol?: number, abs_tol?: number): boolean;
|
|
14
|
+
static areVectorsClose(point1: THREE.Vector3, point2: THREE.Vector3, ref_tol?: number, abs_tol?: number): boolean;
|
|
15
|
+
static getArcAngleSpanInRadian(startAngle: number, endAngle: number): number;
|
|
16
|
+
static getIntegerPartLength(num: number): number;
|
|
17
|
+
static getRelativeEps(num: number, epsilon?: number): number;
|
|
18
|
+
static getVector2RelativeEps(vec: THREE.Vector2, epsilon?: number): number;
|
|
19
|
+
static getControlPointByTwoPoints(p1: THREE.Vector2, p2: THREE.Vector2): THREE.Vector2;
|
|
20
|
+
static convertPointFromUEToGltf(point: Vector3): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
z: number;
|
|
24
|
+
};
|
|
25
|
+
static convertPointFromGltfToUE(point: Vector3): {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
z: number;
|
|
29
|
+
};
|
|
30
|
+
static convertPointFromUEToRevit(point: Vector3): {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
z: number;
|
|
34
|
+
};
|
|
35
|
+
static convertPointFromRevitToUE(point: Vector3): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
z: number;
|
|
39
|
+
};
|
|
40
|
+
static getBox(point1: Vector3, point2: Vector3): number[];
|
|
41
|
+
static getCenter(box: Box): {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
z: number;
|
|
45
|
+
};
|
|
46
|
+
static convertBoxFromGltfToUE(box: Box): number[];
|
|
47
|
+
static convertBoxFromUEToGltf(box: Box): number[];
|
|
48
|
+
static convertBoxFromRevitToUE(box: Box): number[];
|
|
49
|
+
static convertBoxFromUEToRevit(box: Box): number[];
|
|
50
|
+
static clamp(value: number, min: number, max: number): number;
|
|
51
|
+
static getLookAtMatrix(eye: Vector3, target: Vector3, up: Vector3): number[];
|
|
52
|
+
static getLocationFromMatrix(matrix: Mat4): {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
z: number;
|
|
56
|
+
};
|
|
57
|
+
static toDegrees(radians: number): number;
|
|
58
|
+
static toRadians(degrees: number): number;
|
|
59
|
+
}
|