@mlightcad/cad-simple-viewer 1.8.0-preview.3 → 1.8.0-preview.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +206 -204
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-D_0b6okm.js +890 -0
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-DcZiBNvh.js +1 -0
- package/dist/cad-simple-viewer-AcUiFileOpenSession-AGSCe0Nv.js +324 -0
- package/dist/{cad-simple-viewer-AcUiFileOpenSession-BCcqBAH9.js → cad-simple-viewer-AcUiFileOpenSession-Bo3U3wCu.js} +707 -167
- package/dist/cad-simple-viewer-file-open-panel.js +26 -24
- package/dist/cad-simple-viewer-file-open-panel.umd.cjs +1 -1
- package/dist/cad-simple-viewer.js +64409 -41558
- package/dist/cad-simple-viewer.umd.cjs +1659 -497
- package/dist/mtext-renderer-worker.js +4 -5
- package/file-open-panel.ts +6 -6
- package/icons.ts +7 -7
- package/lib/app/AcApClipboard.d.ts +97 -0
- package/lib/app/AcApClipboard.d.ts.map +1 -0
- package/lib/app/AcApClipboard.js +270 -0
- package/lib/app/AcApClipboard.js.map +1 -0
- package/lib/app/AcApContext.d.ts +10 -0
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +24 -8
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +63 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +264 -35
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +11 -11
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApOpenFileDialog.d.ts +2 -2
- package/lib/app/AcApOpenFileDialog.js +2 -2
- package/lib/app/AcApPaletteService.d.ts +154 -0
- package/lib/app/AcApPaletteService.d.ts.map +1 -0
- package/lib/app/AcApPaletteService.js +327 -0
- package/lib/app/AcApPaletteService.js.map +1 -0
- package/lib/app/acapHealModelLayoutLink.d.ts +30 -0
- package/lib/app/acapHealModelLayoutLink.d.ts.map +1 -0
- package/lib/app/acapHealModelLayoutLink.js +192 -0
- package/lib/app/acapHealModelLayoutLink.js.map +1 -0
- package/lib/app/dataSource/AcApLocalDataSource.d.ts +1 -1
- package/lib/app/dataSource/AcApLocalDataSource.js +2 -2
- package/lib/app/dataSource/AcApLocalDataSource.js.map +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js.map +1 -1
- package/lib/app/index.d.ts +2 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +2 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApShortCutToolbarDocBind.d.ts.map +1 -1
- package/lib/command/AcApShortCutToolbarDocBind.js +30 -3
- package/lib/command/AcApShortCutToolbarDocBind.js.map +1 -1
- package/lib/command/AcApUcsCmd.d.ts +26 -0
- package/lib/command/AcApUcsCmd.d.ts.map +1 -0
- package/lib/command/AcApUcsCmd.js +545 -0
- package/lib/command/AcApUcsCmd.js.map +1 -0
- package/lib/command/AcApViewRestoreCmd.d.ts +13 -0
- package/lib/command/AcApViewRestoreCmd.d.ts.map +1 -0
- package/lib/command/AcApViewRestoreCmd.js +101 -0
- package/lib/command/AcApViewRestoreCmd.js.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts +57 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.js +618 -0
- package/lib/command/block/AcApDashBSearchCmd.js.map +1 -0
- package/lib/command/block/index.d.ts +2 -0
- package/lib/command/block/index.d.ts.map +1 -0
- package/lib/command/block/index.js +2 -0
- package/lib/command/block/index.js.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts +61 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.js +203 -0
- package/lib/command/clipboard/AcApClipboardUtils.js.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts +13 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js +95 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js +85 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts +11 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.js +91 -0
- package/lib/command/clipboard/AcApCutClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts +23 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js +127 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts +14 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js +100 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js +99 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts +37 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js +87 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js.map +1 -0
- package/lib/command/clipboard/index.d.ts +9 -0
- package/lib/command/clipboard/index.d.ts.map +1 -0
- package/lib/command/clipboard/index.js +9 -0
- package/lib/command/clipboard/index.js.map +1 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts +8 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApBlockPreviewConvertor.js +16 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.js.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts +32 -0
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.js +70 -14
- package/lib/command/convert/AcApEntityPreviewConvertor.js.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.d.ts +7 -0
- package/lib/command/draw/AcApDimBlockUtil.d.ts.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.js +16 -54
- package/lib/command/draw/AcApDimBlockUtil.js.map +1 -1
- package/lib/command/draw/AcApLeaderCmd.d.ts +49 -0
- package/lib/command/draw/AcApLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApLeaderCmd.js +611 -0
- package/lib/command/draw/AcApLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts +41 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.js +632 -0
- package/lib/command/draw/AcApMLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts +137 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js +411 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts +13 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js +245 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts +7 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.js +141 -0
- package/lib/command/draw/acedRenderDimStylePreview.js.map +1 -0
- package/lib/command/draw/dimStylePreview.d.ts +62 -0
- package/lib/command/draw/dimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/dimStylePreview.js +723 -0
- package/lib/command/draw/dimStylePreview.js.map +1 -0
- package/lib/command/draw/index.d.ts +6 -0
- package/lib/command/draw/index.d.ts.map +1 -1
- package/lib/command/draw/index.js +6 -0
- package/lib/command/draw/index.js.map +1 -1
- package/lib/command/group/AcApDashGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApDashGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApDashGroupCmd.js +457 -0
- package/lib/command/group/AcApDashGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupCmd.js +253 -0
- package/lib/command/group/AcApGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts +14 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.js +241 -0
- package/lib/command/group/AcApGroupEditCmd.js.map +1 -0
- package/lib/command/group/AcApUngroupCmd.d.ts +20 -0
- package/lib/command/group/AcApUngroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApUngroupCmd.js +249 -0
- package/lib/command/group/AcApUngroupCmd.js.map +1 -0
- package/lib/command/group/index.d.ts +5 -0
- package/lib/command/group/index.d.ts.map +1 -0
- package/lib/command/group/index.js +5 -0
- package/lib/command/group/index.js.map +1 -0
- package/lib/command/index.d.ts +5 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +5 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts +9 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.js +21 -7
- package/lib/command/markup/AcApMarkupSessionBootstrap.js.map +1 -1
- package/lib/command/markup/index.d.ts +1 -1
- package/lib/command/markup/index.d.ts.map +1 -1
- package/lib/command/markup/index.js +4 -2
- package/lib/command/markup/index.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts +7 -0
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +183 -73
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts +23 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.js +57 -1
- package/lib/command/measure/AcApMeasureArcLock.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +3 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js +44 -4
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -1
- package/lib/command/modify/AcApScaleCmd.d.ts +115 -0
- package/lib/command/modify/AcApScaleCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApScaleCmd.js +347 -0
- package/lib/command/modify/AcApScaleCmd.js.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts +56 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.js +115 -0
- package/lib/command/modify/AcApScalePreviewJig.js.map +1 -0
- package/lib/command/modify/index.d.ts +1 -0
- package/lib/command/modify/index.d.ts.map +1 -1
- package/lib/command/modify/index.js +1 -0
- package/lib/command/modify/index.js.map +1 -1
- package/lib/command/ui/AcApFindUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApFindUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApFindUiCmd.js +83 -0
- package/lib/command/ui/AcApFindUiCmd.js.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts +65 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.js +142 -0
- package/lib/command/ui/AcApLayerUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js.map +1 -0
- package/lib/command/ui/index.d.ts +5 -0
- package/lib/command/ui/index.d.ts.map +1 -0
- package/lib/command/ui/index.js +5 -0
- package/lib/command/ui/index.js.map +1 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts +13 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +44 -9
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +21 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +204 -22
- package/lib/editor/grip/AcEdGripManager.js.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts +7 -0
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js +18 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -1
- package/lib/editor/grip/AcEdGripViewport.d.ts +35 -0
- package/lib/editor/grip/AcEdGripViewport.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripViewport.js +68 -0
- package/lib/editor/grip/AcEdGripViewport.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts +24 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js +76 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts +46 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js +187 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js.map +1 -0
- package/lib/editor/grip/index.d.ts +3 -0
- package/lib/editor/grip/index.d.ts.map +1 -1
- package/lib/editor/grip/index.js +3 -0
- package/lib/editor/grip/index.js.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.d.ts +2 -2
- package/lib/editor/input/AcEdOrthoMode.d.ts.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.js +20 -7
- package/lib/editor/input/AcEdOrthoMode.js.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts +16 -0
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.js +24 -3
- package/lib/editor/input/AcEdOsnapCenterMarks.js.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts +0 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.js +3 -16
- package/lib/editor/input/AcEdOsnapResolver.js.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.d.ts.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.js +16 -10
- package/lib/editor/input/AcEdPolarTracking.js.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.js +36 -16
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts +12 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js +20 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +5 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +33 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +30 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +47 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +80 -0
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +40 -4
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.js +199 -3
- package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts +10 -0
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.js +15 -8
- package/lib/editor/view/AcEdViewportBoxSelection.js.map +1 -1
- package/lib/file-open-panel.d.ts.map +1 -1
- package/lib/file-open-panel.js +4 -0
- package/lib/file-open-panel.js.map +1 -1
- package/lib/find/AcApFindNavigator.d.ts +47 -0
- package/lib/find/AcApFindNavigator.d.ts.map +1 -1
- package/lib/find/AcApFindNavigator.js +13 -5
- package/lib/find/AcApFindNavigator.js.map +1 -1
- package/lib/find/findDrawing.d.ts +1 -1
- package/lib/find/findDrawing.d.ts.map +1 -1
- package/lib/find/findDrawing.js +4 -3
- package/lib/find/findDrawing.js.map +1 -1
- package/lib/find/findText.d.ts +40 -13
- package/lib/find/findText.d.ts.map +1 -1
- package/lib/find/findText.js +100 -44
- package/lib/find/findText.js.map +1 -1
- package/lib/find/index.d.ts +8 -0
- package/lib/find/index.d.ts.map +1 -1
- package/lib/find/index.js +8 -0
- package/lib/find/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +1 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +2 -0
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/AcUiI18n.d.ts +23 -0
- package/lib/i18n/AcUiI18n.d.ts.map +1 -0
- package/lib/i18n/AcUiI18n.js +126 -0
- package/lib/i18n/AcUiI18n.js.map +1 -0
- package/lib/i18n/ar/command.d.ts +103 -6
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +601 -11
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +1423 -579
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +2096 -322
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/ar/main.d.ts +22 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +22 -0
- package/lib/i18n/ar/main.js.map +1 -1
- package/lib/i18n/ar/simpleUi.d.ts +170 -0
- package/lib/i18n/ar/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ar/simpleUi.js +169 -0
- package/lib/i18n/ar/simpleUi.js.map +1 -0
- package/lib/i18n/cs/command.d.ts +111 -1
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +112 -2
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +867 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +988 -24
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +22 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +23 -1
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/cs/simpleUi.d.ts +170 -0
- package/lib/i18n/cs/simpleUi.d.ts.map +1 -0
- package/lib/i18n/cs/simpleUi.js +169 -0
- package/lib/i18n/cs/simpleUi.js.map +1 -0
- package/lib/i18n/en/command.d.ts +98 -1
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +99 -2
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +844 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +801 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +22 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +22 -0
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/en/simpleUi.d.ts +170 -0
- package/lib/i18n/en/simpleUi.d.ts.map +1 -0
- package/lib/i18n/en/simpleUi.js +169 -0
- package/lib/i18n/en/simpleUi.js.map +1 -0
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +37 -6
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/ja/command.d.ts +605 -0
- package/lib/i18n/ja/command.d.ts.map +1 -0
- package/lib/i18n/ja/command.js +604 -0
- package/lib/i18n/ja/command.js.map +1 -0
- package/lib/i18n/ja/jig.d.ts +2425 -0
- package/lib/i18n/ja/jig.d.ts.map +1 -0
- package/lib/i18n/ja/jig.js +2316 -0
- package/lib/i18n/ja/jig.js.map +1 -0
- package/lib/i18n/ja/main.d.ts +216 -0
- package/lib/i18n/ja/main.d.ts.map +1 -0
- package/lib/i18n/ja/main.js +215 -0
- package/lib/i18n/ja/main.js.map +1 -0
- package/lib/i18n/ja/simpleUi.d.ts +170 -0
- package/lib/i18n/ja/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ja/simpleUi.js +169 -0
- package/lib/i18n/ja/simpleUi.js.map +1 -0
- package/lib/i18n/ko/command.d.ts +605 -0
- package/lib/i18n/ko/command.d.ts.map +1 -0
- package/lib/i18n/ko/command.js +604 -0
- package/lib/i18n/ko/command.js.map +1 -0
- package/lib/i18n/ko/jig.d.ts +2425 -0
- package/lib/i18n/ko/jig.d.ts.map +1 -0
- package/lib/i18n/ko/jig.js +2316 -0
- package/lib/i18n/ko/jig.js.map +1 -0
- package/lib/i18n/ko/main.d.ts +216 -0
- package/lib/i18n/ko/main.d.ts.map +1 -0
- package/lib/i18n/ko/main.js +215 -0
- package/lib/i18n/ko/main.js.map +1 -0
- package/lib/i18n/ko/simpleUi.d.ts +170 -0
- package/lib/i18n/ko/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ko/simpleUi.js +169 -0
- package/lib/i18n/ko/simpleUi.js.map +1 -0
- package/lib/i18n/tr/command.d.ts +111 -1
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +112 -2
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +867 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +1096 -24
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +22 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +23 -1
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/tr/simpleUi.d.ts +170 -0
- package/lib/i18n/tr/simpleUi.d.ts.map +1 -0
- package/lib/i18n/tr/simpleUi.js +169 -0
- package/lib/i18n/tr/simpleUi.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +98 -1
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +99 -2
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +844 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +793 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +22 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +22 -0
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/i18n/zh/simpleUi.d.ts +170 -0
- package/lib/i18n/zh/simpleUi.d.ts.map +1 -0
- package/lib/i18n/zh/simpleUi.js +169 -0
- package/lib/i18n/zh/simpleUi.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/service/AcApEntityService.d.ts +36 -2
- package/lib/service/AcApEntityService.d.ts.map +1 -1
- package/lib/service/AcApEntityService.js +92 -23
- package/lib/service/AcApEntityService.js.map +1 -1
- package/lib/service/AcApGroup.d.ts +95 -0
- package/lib/service/AcApGroup.d.ts.map +1 -0
- package/lib/service/AcApGroup.js +421 -0
- package/lib/service/AcApGroup.js.map +1 -0
- package/lib/service/AcApLlmSettingsService.d.ts +74 -0
- package/lib/service/AcApLlmSettingsService.d.ts.map +1 -0
- package/lib/service/AcApLlmSettingsService.js +126 -0
- package/lib/service/AcApLlmSettingsService.js.map +1 -0
- package/lib/service/AcApNamedViewService.d.ts +139 -0
- package/lib/service/AcApNamedViewService.d.ts.map +1 -0
- package/lib/service/AcApNamedViewService.js +407 -0
- package/lib/service/AcApNamedViewService.js.map +1 -0
- package/lib/service/AcApTextRecognitionService.d.ts +107 -0
- package/lib/service/AcApTextRecognitionService.d.ts.map +1 -0
- package/lib/service/AcApTextRecognitionService.js +304 -0
- package/lib/service/AcApTextRecognitionService.js.map +1 -0
- package/lib/service/AcApUcsService.d.ts +101 -0
- package/lib/service/AcApUcsService.d.ts.map +1 -0
- package/lib/service/AcApUcsService.js +753 -0
- package/lib/service/AcApUcsService.js.map +1 -0
- package/lib/service/index.d.ts +5 -0
- package/lib/service/index.d.ts.map +1 -1
- package/lib/service/index.js +5 -0
- package/lib/service/index.js.map +1 -1
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts +98 -0
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js +300 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts +149 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js +1464 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts +161 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js +712 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts +85 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.js +233 -0
- package/lib/smartBlock/AcApSmartBlockSession.js.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts +33 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.js +571 -0
- package/lib/smartBlock/AcEdShapeFeatures.js.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts +146 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.js +749 -0
- package/lib/smartBlock/AcEdShapeMatcher.js.map +1 -0
- package/lib/smartBlock/index.d.ts +7 -0
- package/lib/smartBlock/index.d.ts.map +1 -0
- package/lib/smartBlock/index.js +7 -0
- package/lib/smartBlock/index.js.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts +374 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.js +1308 -0
- package/lib/ui/AcApSimpleUiChrome.js.map +1 -0
- package/lib/ui/AcUiColorPicker.d.ts +47 -0
- package/lib/ui/AcUiColorPicker.d.ts.map +1 -0
- package/lib/ui/AcUiColorPicker.js +133 -0
- package/lib/ui/AcUiColorPicker.js.map +1 -0
- package/lib/ui/AcUiFileOpenPanel.js +1 -1
- package/lib/ui/AcUiFileOpenPanel.js.map +1 -1
- package/lib/ui/AcUiFindPaletteView.d.ts +99 -0
- package/lib/ui/AcUiFindPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiFindPaletteView.js +426 -0
- package/lib/ui/AcUiFindPaletteView.js.map +1 -0
- package/lib/ui/AcUiLayerListView.d.ts +114 -0
- package/lib/ui/AcUiLayerListView.d.ts.map +1 -0
- package/lib/ui/AcUiLayerListView.js +443 -0
- package/lib/ui/AcUiLayerListView.js.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts +83 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.js +341 -0
- package/lib/ui/AcUiMeasurementPaletteView.js.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts +141 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.js +524 -0
- package/lib/ui/AcUiReviewPaletteView.js.map +1 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts +24 -2
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.js +48 -6
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -1
- package/lib/ui/AcUiSimpleUiOptions.d.ts +88 -0
- package/lib/ui/AcUiSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiOptions.js +2 -0
- package/lib/ui/AcUiSimpleUiOptions.js.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts +12 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.js +28 -0
- package/lib/ui/AcUiSimpleUiStyles.js.map +1 -0
- package/lib/ui/AcUiThemeSync.d.ts +58 -0
- package/lib/ui/AcUiThemeSync.d.ts.map +1 -0
- package/lib/ui/AcUiThemeSync.js +114 -0
- package/lib/ui/AcUiThemeSync.js.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts +20 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js +46 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts +204 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.js +926 -0
- package/lib/ui/dock/AcUiDockPanel.js.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts +9 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.js +27 -0
- package/lib/ui/dock/acuiDockPanelStyles.js.map +1 -0
- package/lib/ui/dock/index.d.ts +3 -0
- package/lib/ui/dock/index.d.ts.map +1 -0
- package/lib/ui/dock/index.js +3 -0
- package/lib/ui/dock/index.js.map +1 -0
- package/lib/ui/icons.d.ts +22 -14
- package/lib/ui/icons.d.ts.map +1 -1
- package/lib/ui/icons.js +42 -32
- package/lib/ui/icons.js.map +1 -1
- package/lib/ui/index.d.ts +12 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +11 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/toolbar/AcUiToolbar.d.ts +1 -1
- package/lib/ui/toolbar/AcUiToolbar.js +1 -1
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts +41 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts.map +1 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js +103 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts +40 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js +65 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts +44 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.js +614 -0
- package/lib/ui/toolbar/defaultToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/index.d.ts +3 -1
- package/lib/ui/toolbar/index.d.ts.map +1 -1
- package/lib/ui/toolbar/index.js +1 -0
- package/lib/ui/toolbar/index.js.map +1 -1
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts +25 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts.map +1 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js +164 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts +22 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js +47 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts +46 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.js +161 -0
- package/lib/ui/toolbar/resolveToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts +17 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js +39 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts +15 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.js +14 -0
- package/lib/ui/toolbar/simpleUiPresets.js.map +1 -0
- package/lib/ui/toolbar/types.d.ts +18 -0
- package/lib/ui/toolbar/types.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.d.ts +19 -0
- package/lib/util/AcApFontUtil.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.js +108 -13
- package/lib/util/AcApFontUtil.js.map +1 -1
- package/lib/util/AcApGeTransform.d.ts +8 -0
- package/lib/util/AcApGeTransform.d.ts.map +1 -1
- package/lib/util/AcApGeTransform.js +13 -0
- package/lib/util/AcApGeTransform.js.map +1 -1
- package/lib/util/AcApTextMeasure.d.ts +43 -0
- package/lib/util/AcApTextMeasure.d.ts.map +1 -0
- package/lib/util/AcApTextMeasure.js +82 -0
- package/lib/util/AcApTextMeasure.js.map +1 -0
- package/lib/util/acapResolveOpenFileType.d.ts +12 -0
- package/lib/util/acapResolveOpenFileType.d.ts.map +1 -0
- package/lib/util/acapResolveOpenFileType.js +22 -0
- package/lib/util/acapResolveOpenFileType.js.map +1 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcApUcsIconOverlay.d.ts +26 -0
- package/lib/view/AcApUcsIconOverlay.d.ts.map +1 -0
- package/lib/view/AcApUcsIconOverlay.js +143 -0
- package/lib/view/AcApUcsIconOverlay.js.map +1 -0
- package/lib/view/AcEdViewKeyHandler.d.ts +11 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +39 -3
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/lib/view/AcTrEntityDisplayController.d.ts +5 -0
- package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -1
- package/lib/view/AcTrEntityDisplayController.js +5 -0
- package/lib/view/AcTrEntityDisplayController.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +27 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +40 -0
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +55 -1
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +252 -51
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +0 -12
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +0 -20
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +6 -0
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
- package/lib/view/AcTrLayoutViewManager.js +8 -0
- package/lib/view/AcTrLayoutViewManager.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +12 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +65 -16
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +92 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +367 -92
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/AcTrViewSessionState.d.ts +5 -0
- package/lib/view/AcTrViewSessionState.d.ts.map +1 -1
- package/package.json +12 -16
- package/src/file-open-panel.ts +93 -89
- package/src/ui/icons.ts +428 -411
- package/dist/cad-simple-viewer-AcUiFileOpenSession-drptdOYc.js +0 -324
- package/find.ts +0 -7
- package/src/find/AcApFindNavigator.ts +0 -190
- package/src/find/findDrawing.ts +0 -211
- package/src/find/findText.ts +0 -624
- package/src/find/index.ts +0 -2
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { acdbDecodeDimStyleColor, AcDbDimStyleTableRecord } from '@mlightcad/data-model';
|
|
13
|
+
/** Width of the preview drawing in SVG user units. */
|
|
14
|
+
export var DIM_PREVIEW_WIDTH = 420;
|
|
15
|
+
/** Height of the preview drawing in SVG user units. */
|
|
16
|
+
export var DIM_PREVIEW_HEIGHT = 250;
|
|
17
|
+
/**
|
|
18
|
+
* Pixel size used for one drawing unit of a DIMSTYLE value.
|
|
19
|
+
*
|
|
20
|
+
* DIMSCALE is deliberately not applied: like AutoCAD's fit-to-window preview,
|
|
21
|
+
* the whole illustration is normalized so that annotation sizes remain
|
|
22
|
+
* comparable between styles.
|
|
23
|
+
*/
|
|
24
|
+
var PX_PER_UNIT = 6;
|
|
25
|
+
var GEOMETRY_STROKE = 1.4;
|
|
26
|
+
var DIMENSION_STROKE = 1.15;
|
|
27
|
+
var DEFAULT_STYLE = new AcDbDimStyleTableRecord();
|
|
28
|
+
function clamp(value, min, max) {
|
|
29
|
+
return Math.min(max, Math.max(min, value));
|
|
30
|
+
}
|
|
31
|
+
function asNumber(value, fallback) {
|
|
32
|
+
var parsed = Number(value);
|
|
33
|
+
return value == null || !Number.isFinite(parsed) ? fallback : parsed;
|
|
34
|
+
}
|
|
35
|
+
function asFlag(value) {
|
|
36
|
+
return asNumber(value, 0) !== 0;
|
|
37
|
+
}
|
|
38
|
+
/** UI token with Element Plus fallback so both the Vue dialog and plain DOM share it. */
|
|
39
|
+
var UI = {
|
|
40
|
+
text: 'var(--ml-ui-text, var(--el-text-color-primary, #303133))',
|
|
41
|
+
textMuted: 'var(--ml-ui-text-muted, var(--el-text-color-secondary, #606266))',
|
|
42
|
+
accent: 'var(--ml-ui-accent, var(--el-color-primary, #409eff))'
|
|
43
|
+
};
|
|
44
|
+
function resolveColor(raw, fallback) {
|
|
45
|
+
var _a;
|
|
46
|
+
var color = acdbDecodeDimStyleColor(raw);
|
|
47
|
+
if (color.isForeground)
|
|
48
|
+
return UI.text;
|
|
49
|
+
if (color.isByBlock || color.isByLayer)
|
|
50
|
+
return fallback;
|
|
51
|
+
return (_a = color.cssColor) !== null && _a !== void 0 ? _a : fallback;
|
|
52
|
+
}
|
|
53
|
+
function classifyArrow(style) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (asNumber(style.dimtsz, 0) > 0)
|
|
56
|
+
return 'tick';
|
|
57
|
+
var name = String((_a = style.dimblk) !== null && _a !== void 0 ? _a : '').toUpperCase();
|
|
58
|
+
if (!name || name === '.' || name === 'CLOSEDFILLED')
|
|
59
|
+
return 'filled';
|
|
60
|
+
if (name.includes('DOT'))
|
|
61
|
+
return 'dot';
|
|
62
|
+
if (name.includes('OPEN'))
|
|
63
|
+
return 'open';
|
|
64
|
+
if (name.includes('ARCHTICK') || name.includes('OBLIQUE'))
|
|
65
|
+
return 'tick';
|
|
66
|
+
if (name.includes('NONE'))
|
|
67
|
+
return 'none';
|
|
68
|
+
if (name.includes('ORIGIN'))
|
|
69
|
+
return 'origin';
|
|
70
|
+
if (name.includes('BOX'))
|
|
71
|
+
return 'box';
|
|
72
|
+
if (name.includes('CLOSEDBLANK'))
|
|
73
|
+
return 'open';
|
|
74
|
+
return 'filled';
|
|
75
|
+
}
|
|
76
|
+
function addLine(scene, p1, p2, stroke, strokeWidth) {
|
|
77
|
+
if (strokeWidth === void 0) { strokeWidth = DIMENSION_STROKE; }
|
|
78
|
+
scene.lines.push({
|
|
79
|
+
x1: p1.x,
|
|
80
|
+
y1: p1.y,
|
|
81
|
+
x2: p2.x,
|
|
82
|
+
y2: p2.y,
|
|
83
|
+
stroke: stroke,
|
|
84
|
+
strokeWidth: strokeWidth
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function addArrow(scene, tip, direction, size, kind, color) {
|
|
88
|
+
if (kind === 'none' || size <= 0)
|
|
89
|
+
return;
|
|
90
|
+
var ux = direction.x;
|
|
91
|
+
var uy = direction.y;
|
|
92
|
+
var baseX = tip.x - ux * size;
|
|
93
|
+
var baseY = tip.y - uy * size;
|
|
94
|
+
var px = -uy;
|
|
95
|
+
var py = ux;
|
|
96
|
+
var half = size * 0.34;
|
|
97
|
+
switch (kind) {
|
|
98
|
+
case 'filled':
|
|
99
|
+
scene.paths.push({
|
|
100
|
+
d: "M ".concat(tip.x, " ").concat(tip.y, " L ").concat(baseX + px * half, " ").concat(baseY + py * half, " L ").concat(baseX - px * half, " ").concat(baseY - py * half, " Z"),
|
|
101
|
+
stroke: 'none',
|
|
102
|
+
strokeWidth: 0,
|
|
103
|
+
fill: color
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
case 'open':
|
|
107
|
+
scene.paths.push({
|
|
108
|
+
d: "M ".concat(baseX + px * half, " ").concat(baseY + py * half, " L ").concat(tip.x, " ").concat(tip.y, " L ").concat(baseX - px * half, " ").concat(baseY - py * half),
|
|
109
|
+
stroke: color,
|
|
110
|
+
strokeWidth: DIMENSION_STROKE,
|
|
111
|
+
fill: 'none'
|
|
112
|
+
});
|
|
113
|
+
break;
|
|
114
|
+
case 'tick': {
|
|
115
|
+
var h = size * 0.55;
|
|
116
|
+
var dx = (ux + px) / Math.SQRT2;
|
|
117
|
+
var dy = (uy + py) / Math.SQRT2;
|
|
118
|
+
addLine(scene, { x: tip.x - dx * h, y: tip.y - dy * h }, { x: tip.x + dx * h, y: tip.y + dy * h }, color);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case 'dot':
|
|
122
|
+
scene.circles.push({
|
|
123
|
+
cx: tip.x,
|
|
124
|
+
cy: tip.y,
|
|
125
|
+
r: Math.max(1.4, size * 0.2),
|
|
126
|
+
stroke: 'none',
|
|
127
|
+
strokeWidth: 0,
|
|
128
|
+
fill: color
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
case 'box': {
|
|
132
|
+
var h = size * 0.5;
|
|
133
|
+
var p1 = { x: baseX + px * h, y: baseY + py * h };
|
|
134
|
+
var p2 = { x: tip.x + px * h, y: tip.y + py * h };
|
|
135
|
+
var p3 = { x: tip.x - px * h, y: tip.y - py * h };
|
|
136
|
+
var p4 = { x: baseX - px * h, y: baseY - py * h };
|
|
137
|
+
scene.paths.push({
|
|
138
|
+
d: "M ".concat(p1.x, " ").concat(p1.y, " L ").concat(p2.x, " ").concat(p2.y, " L ").concat(p3.x, " ").concat(p3.y, " L ").concat(p4.x, " ").concat(p4.y, " Z"),
|
|
139
|
+
stroke: color,
|
|
140
|
+
strokeWidth: 1,
|
|
141
|
+
fill: 'none'
|
|
142
|
+
});
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case 'origin': {
|
|
146
|
+
var h = size * 0.5;
|
|
147
|
+
addLine(scene, { x: tip.x - h, y: tip.y }, { x: tip.x + h, y: tip.y }, color);
|
|
148
|
+
addLine(scene, { x: tip.x, y: tip.y - h }, { x: tip.x, y: tip.y + h }, color);
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function estimateTextWidth(text, fontSize) {
|
|
154
|
+
var e_1, _a;
|
|
155
|
+
var factor = 0;
|
|
156
|
+
try {
|
|
157
|
+
for (var text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {
|
|
158
|
+
var char = text_1_1.value;
|
|
159
|
+
factor += /[\u3000-\u9fff\uff00-\uffef]/.test(char) ? 1 : 0.58;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
163
|
+
finally {
|
|
164
|
+
try {
|
|
165
|
+
if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);
|
|
166
|
+
}
|
|
167
|
+
finally { if (e_1) throw e_1.error; }
|
|
168
|
+
}
|
|
169
|
+
return factor * fontSize;
|
|
170
|
+
}
|
|
171
|
+
/** Convert MTEXT-style codes produced by the data model into plain SVG text. */
|
|
172
|
+
function sanitizeDimensionText(raw) {
|
|
173
|
+
var decode = function (value) {
|
|
174
|
+
return value.replace(/%%d/gi, '°').replace(/%%c/gi, '⌀').replace(/%%p/gi, '±');
|
|
175
|
+
};
|
|
176
|
+
var replaceTolerance = function (text) {
|
|
177
|
+
return text
|
|
178
|
+
.replace(/\{\\H[0-9.]+x;\\S\+([^^;]*)\^-([^;]*);\}/g, function (_match, plus, minus) {
|
|
179
|
+
return plus === minus ? "\u00B1".concat(plus) : " ".concat(plus, "/").concat(minus);
|
|
180
|
+
})
|
|
181
|
+
.replace(/\\S\+([^^;]*)\^-([^;]*);/g, function (_match, plus, minus) {
|
|
182
|
+
return plus === minus ? "\u00B1".concat(plus) : " ".concat(plus, "/").concat(minus);
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
return replaceTolerance(decode(raw)).replace(/[{}]/g, '').trim();
|
|
186
|
+
}
|
|
187
|
+
function gcd(a, b) {
|
|
188
|
+
var x = Math.abs(a);
|
|
189
|
+
var y = Math.abs(b);
|
|
190
|
+
while (y) {
|
|
191
|
+
var temp = y;
|
|
192
|
+
y = x % y;
|
|
193
|
+
x = temp;
|
|
194
|
+
}
|
|
195
|
+
return x || 1;
|
|
196
|
+
}
|
|
197
|
+
function formatDecimal(value, decimals, separator) {
|
|
198
|
+
var fixed = value.toFixed(Math.max(0, decimals));
|
|
199
|
+
return separator && separator !== '.' ? fixed.replace('.', separator) : fixed;
|
|
200
|
+
}
|
|
201
|
+
function formatFractional(value, precision) {
|
|
202
|
+
var whole = Math.trunc(value);
|
|
203
|
+
var fraction = Math.abs(value - whole);
|
|
204
|
+
var denominator = Math.max(1, Math.pow(2, Math.min(6, Math.max(0, precision))));
|
|
205
|
+
var numerator = Math.round(fraction * denominator);
|
|
206
|
+
if (numerator === 0)
|
|
207
|
+
return String(whole);
|
|
208
|
+
if (numerator === denominator) {
|
|
209
|
+
return String(whole + (value < 0 ? -1 : 1));
|
|
210
|
+
}
|
|
211
|
+
var divisor = gcd(numerator, denominator);
|
|
212
|
+
numerator /= divisor;
|
|
213
|
+
var reducedDenominator = denominator / divisor;
|
|
214
|
+
if (whole === 0) {
|
|
215
|
+
return "".concat(value < 0 ? '-' : '').concat(numerator, "/").concat(reducedDenominator);
|
|
216
|
+
}
|
|
217
|
+
return "".concat(whole, " ").concat(numerator, "/").concat(reducedDenominator);
|
|
218
|
+
}
|
|
219
|
+
function formatArchitectural(value, precision) {
|
|
220
|
+
var sign = value < 0 ? '-' : '';
|
|
221
|
+
var absolute = Math.abs(value);
|
|
222
|
+
var feet = Math.trunc(absolute / 12);
|
|
223
|
+
var inches = absolute - feet * 12;
|
|
224
|
+
var inchText = formatFractional(inches, precision);
|
|
225
|
+
if (feet > 0) {
|
|
226
|
+
return "".concat(sign).concat(feet, "'-").concat(inchText, "\"");
|
|
227
|
+
}
|
|
228
|
+
return "".concat(sign).concat(inchText, "\"");
|
|
229
|
+
}
|
|
230
|
+
function formatEngineering(value, decimals) {
|
|
231
|
+
var feet = Math.trunc(value / 12);
|
|
232
|
+
var inches = value - feet * 12;
|
|
233
|
+
return "".concat(feet, "'-").concat(inches.toFixed(Math.max(0, decimals)), "\"");
|
|
234
|
+
}
|
|
235
|
+
function applyZeroSuppression(body, zin) {
|
|
236
|
+
var text = body;
|
|
237
|
+
if ((zin & 4) !== 0 && text.startsWith('0.')) {
|
|
238
|
+
text = text.slice(1);
|
|
239
|
+
}
|
|
240
|
+
if ((zin & 8) !== 0 && text.includes('.')) {
|
|
241
|
+
text = text.replace(/\.?0+$/, '');
|
|
242
|
+
}
|
|
243
|
+
return text;
|
|
244
|
+
}
|
|
245
|
+
function applyAngularZeroSuppression(body, azin) {
|
|
246
|
+
var text = body;
|
|
247
|
+
if ((azin === 1 || azin === 3) && text.startsWith('0.')) {
|
|
248
|
+
text = text.slice(1);
|
|
249
|
+
}
|
|
250
|
+
if (azin === 2 || azin === 3) {
|
|
251
|
+
text = text
|
|
252
|
+
.replace(/(\.\d*?)0+(%%d|g|r|"|')?$/, '$1$2')
|
|
253
|
+
.replace(/\.(%%d|g|r)/, '$1');
|
|
254
|
+
}
|
|
255
|
+
return text;
|
|
256
|
+
}
|
|
257
|
+
function applyDimPost(body, dimpost) {
|
|
258
|
+
if (!dimpost)
|
|
259
|
+
return body;
|
|
260
|
+
if (dimpost.includes('<>')) {
|
|
261
|
+
return dimpost.split('<>').join(body);
|
|
262
|
+
}
|
|
263
|
+
return "".concat(body).concat(dimpost);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Format the alternate-unit value shown in brackets after the primary
|
|
267
|
+
* measurement, honoring DIMALTF / DIMALTRND / DIMALTD / DIMALTU / DIMALTZ /
|
|
268
|
+
* DIMAPOST the same way the primary measurement honors DIMLFAC / DIMRND /
|
|
269
|
+
* DIMDEC / DIMLUNIT / DIMZIN / DIMPOST.
|
|
270
|
+
*/
|
|
271
|
+
function formatAlternateMeasurement(raw, style) {
|
|
272
|
+
var _a;
|
|
273
|
+
var value = raw * asNumber(style.dimlfac, 1) * (asNumber(style.dimaltf, 0) || 25.4);
|
|
274
|
+
var rounding = asNumber(style.dimaltrnd, 0);
|
|
275
|
+
if (rounding > 0) {
|
|
276
|
+
value = Math.round(value / rounding) * rounding;
|
|
277
|
+
}
|
|
278
|
+
var decimals = Math.max(0, asNumber(style.dimaltd, 2));
|
|
279
|
+
var separator = String(style.dimdsep || '.');
|
|
280
|
+
var body;
|
|
281
|
+
switch (asNumber(style.dimaltu, 2)) {
|
|
282
|
+
case 1:
|
|
283
|
+
body = value.toExponential(decimals);
|
|
284
|
+
break;
|
|
285
|
+
case 3:
|
|
286
|
+
body = formatEngineering(value, decimals);
|
|
287
|
+
break;
|
|
288
|
+
case 4:
|
|
289
|
+
case 6:
|
|
290
|
+
body = formatArchitectural(value, decimals);
|
|
291
|
+
break;
|
|
292
|
+
case 5:
|
|
293
|
+
case 7:
|
|
294
|
+
body = formatFractional(value, decimals);
|
|
295
|
+
break;
|
|
296
|
+
default:
|
|
297
|
+
body = formatDecimal(value, decimals, separator);
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
body = applyZeroSuppression(body, asNumber(style.dimaltz, 0));
|
|
301
|
+
return applyDimPost(body, String((_a = style.dimapost) !== null && _a !== void 0 ? _a : ''));
|
|
302
|
+
}
|
|
303
|
+
/** Format a linear measurement using the same rules as the dimension renderer. */
|
|
304
|
+
function formatLinearMeasurement(raw, style) {
|
|
305
|
+
var _a;
|
|
306
|
+
var value = raw * asNumber(style.dimlfac, 1);
|
|
307
|
+
var rounding = asNumber(style.dimrnd, 0);
|
|
308
|
+
if (rounding > 0) {
|
|
309
|
+
value = Math.round(value / rounding) * rounding;
|
|
310
|
+
}
|
|
311
|
+
var decimals = Math.max(0, asNumber(style.dimdec, 2));
|
|
312
|
+
var separator = String(style.dimdsep || '.');
|
|
313
|
+
var body;
|
|
314
|
+
switch (asNumber(style.dimlunit, 2)) {
|
|
315
|
+
case 1:
|
|
316
|
+
body = value.toExponential(decimals);
|
|
317
|
+
break;
|
|
318
|
+
case 3:
|
|
319
|
+
body = formatEngineering(value, decimals);
|
|
320
|
+
break;
|
|
321
|
+
case 4:
|
|
322
|
+
body = formatArchitectural(value, decimals);
|
|
323
|
+
break;
|
|
324
|
+
case 5:
|
|
325
|
+
body = formatFractional(value, decimals);
|
|
326
|
+
break;
|
|
327
|
+
default:
|
|
328
|
+
body = formatDecimal(value, decimals, separator);
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
body = applyZeroSuppression(body, asNumber(style.dimzin, 0));
|
|
332
|
+
return applyDimPost(body, String((_a = style.dimpost) !== null && _a !== void 0 ? _a : ''));
|
|
333
|
+
}
|
|
334
|
+
/** Format an angular measurement using the dimension style angle settings. */
|
|
335
|
+
function formatAngularMeasurement(radians, style) {
|
|
336
|
+
var _a;
|
|
337
|
+
var absolute = Math.abs(radians);
|
|
338
|
+
var decimals = Math.max(0, asNumber(style.dimadec, 0));
|
|
339
|
+
var separator = String(style.dimdsep || '.');
|
|
340
|
+
var body;
|
|
341
|
+
switch (asNumber(style.dimaunit, 0)) {
|
|
342
|
+
case 1: {
|
|
343
|
+
var total = (absolute * 180) / Math.PI;
|
|
344
|
+
var degrees = Math.floor(total);
|
|
345
|
+
var minutesFloat = (total - degrees) * 60;
|
|
346
|
+
var minutes = Math.floor(minutesFloat);
|
|
347
|
+
var seconds = (minutesFloat - minutes) * 60;
|
|
348
|
+
var secondsText = decimals > 0 ? seconds.toFixed(decimals) : String(Math.round(seconds));
|
|
349
|
+
body = "".concat(degrees, "d").concat(String(minutes).padStart(2, '0'), "'").concat(secondsText, "\"");
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
case 2:
|
|
353
|
+
body = "".concat(formatDecimal((absolute * 200) / Math.PI, decimals, separator), "g");
|
|
354
|
+
break;
|
|
355
|
+
case 3:
|
|
356
|
+
body = "".concat(formatDecimal(absolute, decimals, separator), "r");
|
|
357
|
+
break;
|
|
358
|
+
default:
|
|
359
|
+
body = "".concat(formatDecimal((absolute * 180) / Math.PI, decimals, separator), "%%d");
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
body = applyAngularZeroSuppression(body, asNumber(style.dimazin, 0));
|
|
363
|
+
return applyDimPost(body, String((_a = style.dimpost) !== null && _a !== void 0 ? _a : ''));
|
|
364
|
+
}
|
|
365
|
+
function resolveAnnotation(raw, style, kind) {
|
|
366
|
+
var text = kind === 'angular'
|
|
367
|
+
? formatAngularMeasurement(raw, style)
|
|
368
|
+
: formatLinearMeasurement(raw, style);
|
|
369
|
+
if (kind === 'radial' && !text.startsWith('R')) {
|
|
370
|
+
text = "R".concat(text);
|
|
371
|
+
}
|
|
372
|
+
if (kind !== 'angular' && asNumber(style.dimtol, 0) === 1) {
|
|
373
|
+
var precision = Math.max(0, asNumber(style.dimtdec, 0));
|
|
374
|
+
var plus = asNumber(style.dimtp, 0).toFixed(precision);
|
|
375
|
+
var minus = asNumber(style.dimtm, 0).toFixed(precision);
|
|
376
|
+
text = "".concat(text, "{\\H0.7x;\\S+").concat(plus, "^-").concat(minus, ";}");
|
|
377
|
+
}
|
|
378
|
+
if (kind !== 'angular' && asNumber(style.dimalt, 0) === 1) {
|
|
379
|
+
var alternate = formatAlternateMeasurement(raw, style);
|
|
380
|
+
text = "".concat(text, " [").concat(alternate, "]");
|
|
381
|
+
}
|
|
382
|
+
return text;
|
|
383
|
+
}
|
|
384
|
+
function measuredText(style, raw, kind) {
|
|
385
|
+
return sanitizeDimensionText(resolveAnnotation(raw, style, kind));
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Push a dimension text entry and attach the background fill / frame
|
|
389
|
+
* rectangle (DIMTFILL, negative DIMGAP) and the viewing direction
|
|
390
|
+
* (DIMTXTDIRECTION). `gap` is the drawing-unit text gap already in pixels.
|
|
391
|
+
*/
|
|
392
|
+
function pushDimensionText(scene, style, colors, entry) {
|
|
393
|
+
var _a;
|
|
394
|
+
var text = {
|
|
395
|
+
x: entry.x,
|
|
396
|
+
y: entry.y,
|
|
397
|
+
text: entry.text,
|
|
398
|
+
fontSize: entry.fontSize,
|
|
399
|
+
fill: colors.text,
|
|
400
|
+
textAnchor: entry.textAnchor,
|
|
401
|
+
rotation: entry.rotation
|
|
402
|
+
};
|
|
403
|
+
var showBackground = asNumber(style.dimtfill, 0) !== 0;
|
|
404
|
+
var frame = asNumber(style.dimgap, 1) < 0;
|
|
405
|
+
if (showBackground || frame) {
|
|
406
|
+
var width = estimateTextWidth(entry.text, entry.fontSize);
|
|
407
|
+
var pad = clamp(entry.gap, 1.5, 8);
|
|
408
|
+
var startX = entry.textAnchor === 'middle'
|
|
409
|
+
? entry.x - width / 2
|
|
410
|
+
: entry.textAnchor === 'end'
|
|
411
|
+
? entry.x - width
|
|
412
|
+
: entry.x;
|
|
413
|
+
text.box = {
|
|
414
|
+
x: startX - pad,
|
|
415
|
+
y: entry.y - entry.fontSize * 0.8 - pad,
|
|
416
|
+
w: width + 2 * pad,
|
|
417
|
+
h: entry.fontSize + 2 * pad
|
|
418
|
+
};
|
|
419
|
+
if (showBackground) {
|
|
420
|
+
if (asNumber(style.dimtfill, 0) === 1) {
|
|
421
|
+
// Drawing background color — the canvas of the preview panel.
|
|
422
|
+
text.background = 'var(--el-bg-color)';
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
var color = acdbDecodeDimStyleColor(style.dimtfillclr);
|
|
426
|
+
text.background =
|
|
427
|
+
(_a = color.cssColor) !== null && _a !== void 0 ? _a : (color.isForeground
|
|
428
|
+
? 'var(--el-text-color-primary)'
|
|
429
|
+
: 'var(--el-bg-color)');
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (frame) {
|
|
433
|
+
text.frame = colors.text;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (asNumber(style.dimtxtdirection, 0) === 1) {
|
|
437
|
+
text.mirror = true;
|
|
438
|
+
}
|
|
439
|
+
scene.texts.push(text);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Draw one linear/aligned dimension.
|
|
443
|
+
*
|
|
444
|
+
* `p1` and `p2` are the measured points, and the dimension line is offset
|
|
445
|
+
* along the left-hand normal of `p1 -> p2` by `offset` pixels.
|
|
446
|
+
*/
|
|
447
|
+
function addLinearDimension(scene, style, metrics, colors, arrow, p1, p2, offset, raw) {
|
|
448
|
+
var dx = p2.x - p1.x;
|
|
449
|
+
var dy = p2.y - p1.y;
|
|
450
|
+
var length = Math.hypot(dx, dy);
|
|
451
|
+
if (length <= 0.001)
|
|
452
|
+
return;
|
|
453
|
+
var ux = dx / length;
|
|
454
|
+
var uy = dy / length;
|
|
455
|
+
var nx = uy;
|
|
456
|
+
var ny = -ux;
|
|
457
|
+
var at = function (t, n) { return ({
|
|
458
|
+
x: p1.x + ux * t + nx * n,
|
|
459
|
+
y: p1.y + uy * t + ny * n
|
|
460
|
+
}); };
|
|
461
|
+
if (!asFlag(style.dimse1)) {
|
|
462
|
+
addLine(scene, at(0, metrics.exo), at(0, offset + metrics.exe), colors.extension, 1);
|
|
463
|
+
}
|
|
464
|
+
if (!asFlag(style.dimse2)) {
|
|
465
|
+
addLine(scene, at(length, metrics.exo), at(length, offset + metrics.exe), colors.extension, 1);
|
|
466
|
+
}
|
|
467
|
+
var text = measuredText(style, raw, 'linear');
|
|
468
|
+
var fontSize = metrics.text;
|
|
469
|
+
var textWidth = estimateTextWidth(text, fontSize);
|
|
470
|
+
var gap = metrics.gap;
|
|
471
|
+
var startT = -metrics.dle;
|
|
472
|
+
var endT = length + metrics.dle;
|
|
473
|
+
var textT = length / 2;
|
|
474
|
+
var anchor = 'middle';
|
|
475
|
+
var justification = asNumber(style.dimjust, 0);
|
|
476
|
+
if (justification === 1) {
|
|
477
|
+
textT = gap;
|
|
478
|
+
anchor = 'start';
|
|
479
|
+
}
|
|
480
|
+
else if (justification === 2) {
|
|
481
|
+
textT = length - gap;
|
|
482
|
+
anchor = 'end';
|
|
483
|
+
}
|
|
484
|
+
else if (justification === 3) {
|
|
485
|
+
textT = 0;
|
|
486
|
+
anchor = 'start';
|
|
487
|
+
}
|
|
488
|
+
else if (justification === 4) {
|
|
489
|
+
textT = length;
|
|
490
|
+
anchor = 'end';
|
|
491
|
+
}
|
|
492
|
+
var gapStart = anchor === 'start'
|
|
493
|
+
? textT
|
|
494
|
+
: anchor === 'end'
|
|
495
|
+
? textT - textWidth
|
|
496
|
+
: textT - textWidth / 2;
|
|
497
|
+
var gapEnd = anchor === 'start'
|
|
498
|
+
? textT + textWidth
|
|
499
|
+
: anchor === 'end'
|
|
500
|
+
? textT
|
|
501
|
+
: textT + textWidth / 2;
|
|
502
|
+
var suppressFirst = asFlag(style.dimsd1);
|
|
503
|
+
var suppressSecond = asFlag(style.dimsd2);
|
|
504
|
+
var textVertical = asNumber(style.dimtad, 0);
|
|
505
|
+
if (textVertical === 0) {
|
|
506
|
+
if (!suppressFirst) {
|
|
507
|
+
var segmentEnd = Math.min(gapStart, endT);
|
|
508
|
+
if (segmentEnd > startT) {
|
|
509
|
+
addLine(scene, at(startT, offset), at(segmentEnd, offset), colors.dimension);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (!suppressSecond) {
|
|
513
|
+
var segmentStart = Math.max(gapEnd, startT);
|
|
514
|
+
if (segmentStart < endT) {
|
|
515
|
+
addLine(scene, at(segmentStart, offset), at(endT, offset), colors.dimension);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else if (!suppressFirst && !suppressSecond) {
|
|
520
|
+
addLine(scene, at(startT, offset), at(endT, offset), colors.dimension);
|
|
521
|
+
}
|
|
522
|
+
else if (!suppressFirst) {
|
|
523
|
+
var segmentEnd = Math.min(textT, endT);
|
|
524
|
+
if (segmentEnd > startT) {
|
|
525
|
+
addLine(scene, at(startT, offset), at(segmentEnd, offset), colors.dimension);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
else if (!suppressSecond) {
|
|
529
|
+
var segmentStart = Math.max(textT, startT);
|
|
530
|
+
if (segmentStart < endT) {
|
|
531
|
+
addLine(scene, at(segmentStart, offset), at(endT, offset), colors.dimension);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (!suppressFirst) {
|
|
535
|
+
addArrow(scene, at(0, offset), { x: -ux, y: -uy }, metrics.arrow, arrow, colors.dimension);
|
|
536
|
+
}
|
|
537
|
+
if (!suppressSecond) {
|
|
538
|
+
addArrow(scene, at(length, offset), { x: ux, y: uy }, metrics.arrow, arrow, colors.dimension);
|
|
539
|
+
}
|
|
540
|
+
var baseline;
|
|
541
|
+
if (textVertical === 0) {
|
|
542
|
+
baseline = offset + fontSize * 0.35;
|
|
543
|
+
}
|
|
544
|
+
else if (textVertical === 4) {
|
|
545
|
+
baseline = offset - gap - fontSize * 0.8;
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
baseline = offset + gap + fontSize * 0.8;
|
|
549
|
+
}
|
|
550
|
+
var rotation = 0;
|
|
551
|
+
// Preview dimensions sit outside the extension lines, so text alignment
|
|
552
|
+
// follows DIMTOH (see the "Text alignment" option of the Text tab).
|
|
553
|
+
if (!asFlag(style.dimtoh)) {
|
|
554
|
+
rotation = (Math.atan2(uy, ux) * 180) / Math.PI;
|
|
555
|
+
if (rotation > 90)
|
|
556
|
+
rotation -= 180;
|
|
557
|
+
else if (rotation < -90)
|
|
558
|
+
rotation += 180;
|
|
559
|
+
}
|
|
560
|
+
var position = at(textT, baseline);
|
|
561
|
+
pushDimensionText(scene, style, colors, {
|
|
562
|
+
x: position.x,
|
|
563
|
+
y: position.y,
|
|
564
|
+
text: text,
|
|
565
|
+
fontSize: fontSize,
|
|
566
|
+
textAnchor: anchor,
|
|
567
|
+
rotation: rotation,
|
|
568
|
+
gap: gap
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
/** Draw the fillet radius dimension at the lower-left corner. */
|
|
572
|
+
function addRadialDimension(scene, style, metrics, colors, arrow, center, radius, raw) {
|
|
573
|
+
var angle = (3 * Math.PI) / 4;
|
|
574
|
+
var rx = Math.cos(angle);
|
|
575
|
+
var ry = Math.sin(angle);
|
|
576
|
+
var arcPoint = {
|
|
577
|
+
x: center.x + rx * radius,
|
|
578
|
+
y: center.y + ry * radius
|
|
579
|
+
};
|
|
580
|
+
var elbow = {
|
|
581
|
+
x: arcPoint.x + rx * 24,
|
|
582
|
+
y: arcPoint.y + ry * 24
|
|
583
|
+
};
|
|
584
|
+
var landing = { x: elbow.x - 36, y: elbow.y };
|
|
585
|
+
addLine(scene, arcPoint, elbow, colors.dimension, 1);
|
|
586
|
+
addLine(scene, elbow, landing, colors.dimension, 1);
|
|
587
|
+
addArrow(scene, arcPoint, { x: rx, y: ry }, metrics.arrow, arrow, colors.dimension);
|
|
588
|
+
var text = measuredText(style, raw, 'radial');
|
|
589
|
+
var rotation = 0;
|
|
590
|
+
if (!asFlag(style.dimtoh)) {
|
|
591
|
+
rotation = (angle * 180) / Math.PI;
|
|
592
|
+
if (rotation > 90)
|
|
593
|
+
rotation -= 180;
|
|
594
|
+
else if (rotation < -90)
|
|
595
|
+
rotation += 180;
|
|
596
|
+
}
|
|
597
|
+
pushDimensionText(scene, style, colors, {
|
|
598
|
+
x: elbow.x - 4,
|
|
599
|
+
y: elbow.y - metrics.gap,
|
|
600
|
+
text: text,
|
|
601
|
+
fontSize: metrics.text,
|
|
602
|
+
textAnchor: 'end',
|
|
603
|
+
rotation: rotation,
|
|
604
|
+
gap: metrics.gap
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
/** Draw the angular dimension at the lower-right vertex. */
|
|
608
|
+
function addAngularDimension(scene, style, metrics, colors, arrow, vertex, startDegrees, endDegrees, rawRadians) {
|
|
609
|
+
var radius = 66;
|
|
610
|
+
var start = (startDegrees * Math.PI) / 180;
|
|
611
|
+
var end = (endDegrees * Math.PI) / 180;
|
|
612
|
+
var startPoint = {
|
|
613
|
+
x: vertex.x + Math.cos(start) * radius,
|
|
614
|
+
y: vertex.y + Math.sin(start) * radius
|
|
615
|
+
};
|
|
616
|
+
var endPoint = {
|
|
617
|
+
x: vertex.x + Math.cos(end) * radius,
|
|
618
|
+
y: vertex.y + Math.sin(end) * radius
|
|
619
|
+
};
|
|
620
|
+
scene.paths.push({
|
|
621
|
+
d: "M ".concat(startPoint.x, " ").concat(startPoint.y, " A ").concat(radius, " ").concat(radius, " 0 0 1 ").concat(endPoint.x, " ").concat(endPoint.y),
|
|
622
|
+
stroke: colors.dimension,
|
|
623
|
+
strokeWidth: DIMENSION_STROKE,
|
|
624
|
+
fill: 'none'
|
|
625
|
+
});
|
|
626
|
+
addArrow(scene, startPoint, { x: Math.sin(start), y: -Math.cos(start) }, metrics.arrow, arrow, colors.dimension);
|
|
627
|
+
addArrow(scene, endPoint, { x: -Math.sin(end), y: Math.cos(end) }, metrics.arrow, arrow, colors.dimension);
|
|
628
|
+
var middle = (start + end) / 2;
|
|
629
|
+
var textRadius = radius + metrics.gap + metrics.text / 2 + 2;
|
|
630
|
+
var text = measuredText(style, rawRadians, 'angular');
|
|
631
|
+
var rotation = 0;
|
|
632
|
+
if (!asFlag(style.dimtoh)) {
|
|
633
|
+
rotation = (middle * 180) / Math.PI;
|
|
634
|
+
if (rotation > 90)
|
|
635
|
+
rotation -= 180;
|
|
636
|
+
else if (rotation < -90)
|
|
637
|
+
rotation += 180;
|
|
638
|
+
}
|
|
639
|
+
pushDimensionText(scene, style, colors, {
|
|
640
|
+
x: vertex.x + Math.cos(middle) * textRadius,
|
|
641
|
+
y: vertex.y + Math.sin(middle) * textRadius + metrics.text * 0.35,
|
|
642
|
+
text: text,
|
|
643
|
+
fontSize: metrics.text,
|
|
644
|
+
textAnchor: 'middle',
|
|
645
|
+
rotation: rotation,
|
|
646
|
+
gap: metrics.gap
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Build a scene that mirrors the illustration shown in AutoCAD's Dimension
|
|
651
|
+
* Style Manager: a beveled plate with a rounded corner, a center mark, an
|
|
652
|
+
* aligned dimension, linear dimensions, a radius and an angular dimension.
|
|
653
|
+
*/
|
|
654
|
+
export function buildDimStylePreview(style) {
|
|
655
|
+
var source = style !== null && style !== void 0 ? style : DEFAULT_STYLE;
|
|
656
|
+
var scene = {
|
|
657
|
+
lines: [],
|
|
658
|
+
paths: [],
|
|
659
|
+
circles: [],
|
|
660
|
+
texts: []
|
|
661
|
+
};
|
|
662
|
+
var colors = {
|
|
663
|
+
geometry: UI.text,
|
|
664
|
+
dimension: resolveColor(source.dimclrd, UI.accent),
|
|
665
|
+
extension: resolveColor(source.dimclre, UI.textMuted),
|
|
666
|
+
text: resolveColor(source.dimclrt, UI.text)
|
|
667
|
+
};
|
|
668
|
+
var tickSize = asNumber(source.dimtsz, 0);
|
|
669
|
+
var metrics = {
|
|
670
|
+
text: clamp(asNumber(source.dimtxt, 2.5) * PX_PER_UNIT, 7, 20),
|
|
671
|
+
arrow: tickSize > 0
|
|
672
|
+
? clamp(tickSize * PX_PER_UNIT * 2, 3, 20)
|
|
673
|
+
: clamp(asNumber(source.dimasz, 2.5) * PX_PER_UNIT, 3, 20),
|
|
674
|
+
// DIMGAP magnitude drives spacing; a negative value only means "draw frame".
|
|
675
|
+
gap: clamp(Math.abs(asNumber(source.dimgap, 1)) * PX_PER_UNIT, 1.5, 12),
|
|
676
|
+
exo: clamp(asNumber(source.dimexo, 0.625) * PX_PER_UNIT, 0, 12),
|
|
677
|
+
exe: clamp(asNumber(source.dimexe, 0.18) * PX_PER_UNIT, 0, 12),
|
|
678
|
+
dle: clamp(asNumber(source.dimdle, 0) * PX_PER_UNIT, 0, 16)
|
|
679
|
+
};
|
|
680
|
+
var arrow = classifyArrow(source);
|
|
681
|
+
var corner = { x: 96, y: 72 };
|
|
682
|
+
var armEnd = { x: 210, y: 72 };
|
|
683
|
+
var bevelEnd = { x: 313, y: 104 };
|
|
684
|
+
var rightBottom = { x: 332, y: 212 };
|
|
685
|
+
var bottomStart = { x: 144, y: 212 };
|
|
686
|
+
var filletStart = { x: 96, y: 164 };
|
|
687
|
+
var filletRadius = 48;
|
|
688
|
+
var filletCenter = { x: 144, y: 164 };
|
|
689
|
+
var holeCenter = { x: 185, y: 146 };
|
|
690
|
+
var holeRadius = 42;
|
|
691
|
+
scene.paths.push({
|
|
692
|
+
d: "M ".concat(corner.x, " ").concat(corner.y, " L ").concat(armEnd.x, " ").concat(armEnd.y, " ") +
|
|
693
|
+
"L ".concat(bevelEnd.x, " ").concat(bevelEnd.y, " L ").concat(rightBottom.x, " ").concat(rightBottom.y, " ") +
|
|
694
|
+
"L ".concat(bottomStart.x, " ").concat(bottomStart.y, " ") +
|
|
695
|
+
"A ".concat(filletRadius, " ").concat(filletRadius, " 0 0 1 ").concat(filletStart.x, " ").concat(filletStart.y, " Z"),
|
|
696
|
+
stroke: colors.geometry,
|
|
697
|
+
strokeWidth: GEOMETRY_STROKE,
|
|
698
|
+
fill: 'none'
|
|
699
|
+
});
|
|
700
|
+
scene.circles.push({
|
|
701
|
+
cx: holeCenter.x,
|
|
702
|
+
cy: holeCenter.y,
|
|
703
|
+
r: holeRadius,
|
|
704
|
+
stroke: colors.geometry,
|
|
705
|
+
strokeWidth: GEOMETRY_STROKE,
|
|
706
|
+
fill: 'none'
|
|
707
|
+
});
|
|
708
|
+
var centerMark = asNumber(source.dimcen, 2.5);
|
|
709
|
+
if (Math.abs(centerMark) > 0.0001) {
|
|
710
|
+
var half = centerMark < 0
|
|
711
|
+
? holeRadius + Math.abs(centerMark) * PX_PER_UNIT * 0.6
|
|
712
|
+
: Math.max(6, Math.min(holeRadius - 4, Math.abs(centerMark) * PX_PER_UNIT * 0.9));
|
|
713
|
+
addLine(scene, { x: holeCenter.x - half, y: holeCenter.y }, { x: holeCenter.x + half, y: holeCenter.y }, colors.extension, 1);
|
|
714
|
+
addLine(scene, { x: holeCenter.x, y: holeCenter.y - half }, { x: holeCenter.x, y: holeCenter.y + half }, colors.extension, 1);
|
|
715
|
+
}
|
|
716
|
+
addLinearDimension(scene, source, metrics, colors, arrow, corner, armEnd, 28, 1);
|
|
717
|
+
addLinearDimension(scene, source, metrics, colors, arrow, filletStart, corner, 28, 1.75);
|
|
718
|
+
addLinearDimension(scene, source, metrics, colors, arrow, bevelEnd, rightBottom, 28, 2);
|
|
719
|
+
addRadialDimension(scene, source, metrics, colors, arrow, filletCenter, filletRadius, 0.5);
|
|
720
|
+
addAngularDimension(scene, source, metrics, colors, arrow, rightBottom, 180, 260, (80 * Math.PI) / 180);
|
|
721
|
+
return scene;
|
|
722
|
+
}
|
|
723
|
+
//# sourceMappingURL=dimStylePreview.js.map
|