@classcad/react-cad 0.0.0-stage → 3.0.0-beta.20261119090857
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/CHANGELOG.md +55 -0
- package/README.md +98 -2
- package/build/components/UI/CAD/Constraints.d.ts +30 -0
- package/build/components/UI/CAD/Drawing.d.ts +83 -0
- package/build/components/UI/CAD/ListPlaceholder.d.ts +3 -0
- package/build/components/UI/CAD/Messages/Message.d.ts +8 -0
- package/build/components/UI/CAD/Messages/Messages.d.ts +43 -0
- package/build/components/UI/CAD/Messages/index.d.ts +1 -0
- package/build/components/UI/CAD/Messages/msgStore.d.ts +18 -0
- package/build/components/UI/CAD/ModelTree/AssemblyNode.d.ts +5 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/Feature.d.ts +8 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/FeatureList.d.ts +6 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/index.d.ts +1 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/utils.d.ts +26 -0
- package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +56 -0
- package/build/components/UI/CAD/ModelTree/ModelTreeHeader.d.ts +15 -0
- package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
- package/build/components/UI/CAD/ModelTree/primitives.d.ts +6 -0
- package/build/components/UI/CAD/ModelTree/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/PluginBounds.d.ts +8 -0
- package/build/components/UI/CAD/PluginTooltip.d.ts +5 -0
- package/build/components/UI/CAD/PluginsWindows.d.ts +99 -0
- package/build/components/UI/CAD/ReadOnlyContext.d.ts +10 -0
- package/build/components/UI/CAD/SideBar.d.ts +40 -0
- package/build/components/UI/CAD/Solids/Solids.d.ts +23 -0
- package/build/components/UI/CAD/Solids/index.d.ts +1 -0
- package/build/components/UI/CAD/Solids/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/Solids/useVisibleSolids.d.ts +30 -0
- package/build/components/UI/CAD/StageHud.d.ts +9 -0
- package/build/components/UI/CAD/StatusBar.d.ts +11 -0
- package/build/components/UI/CAD/ThemeToggle.d.ts +25 -0
- package/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +3 -0
- package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +3 -0
- package/build/components/UI/CAD/ToolBar/ToolBar.d.ts +24 -0
- package/build/components/UI/CAD/ToolBar/index.d.ts +1 -0
- package/build/components/UI/CAD/ToolBar/useCommands.d.ts +12 -0
- package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +30 -0
- package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +65 -0
- package/build/components/UI/CAD/ViewPlugButtons.d.ts +43 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModal.d.ts +18 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalContext.d.ts +9 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalInner.d.ts +27 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalProvider.d.ts +4 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/OverlayScrollbar.d.ts +6 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/ResizeHandle.d.ts +2 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/clamp.d.ts +1 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/draggableModalReducer.d.ts +123 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/getWindowSize.d.ts +4 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/index.d.ts +3 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/useDrag.d.ts +5 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/usePrevious.d.ts +1 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/useResize.d.ts +7 -0
- package/build/components/UI/CAD/common/BlankDiv.d.ts +3 -0
- package/build/components/UI/CAD/common/Collapse.d.ts +13 -0
- package/build/components/UI/CAD/common/ContextMenu.d.ts +115 -0
- package/build/components/UI/CAD/common/Divider.d.ts +4 -0
- package/build/components/UI/CAD/common/EntityName.d.ts +14 -0
- package/build/components/UI/CAD/common/Img.d.ts +6 -0
- package/build/components/UI/CAD/common/LoadingScreen/LoadingScreen.d.ts +8 -0
- package/build/components/UI/CAD/common/LoadingScreen/Spinner.d.ts +3 -0
- package/build/components/UI/CAD/common/LoadingScreen/index.d.ts +1 -0
- package/build/components/UI/CAD/common/Menu.d.ts +81 -0
- package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
- package/build/components/UI/CAD/common/NameEdit.d.ts +7 -0
- package/build/components/UI/CAD/common/SectionHeader.d.ts +9 -0
- package/build/components/UI/CAD/common/primitives.d.ts +36 -0
- package/build/components/UI/CAD/common/reveal.d.ts +12 -0
- package/build/components/UI/CAD/hooks/index.d.ts +13 -0
- package/build/components/UI/CAD/hooks/useContextMenuInteraction.d.ts +7 -0
- package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/hooks/useCurrentInstance.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useCurrentProduct.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useEditMode.d.ts +40 -0
- package/build/components/UI/CAD/hooks/useFeatureCount.d.ts +6 -0
- package/build/components/UI/CAD/hooks/useGlobalMateInfo.d.ts +6 -0
- package/build/components/UI/CAD/hooks/useHasPending.d.ts +27 -0
- package/build/components/UI/CAD/hooks/useIsDisabled.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useIsLoading.d.ts +25 -0
- package/build/components/UI/CAD/hooks/useIsSketchActive.d.ts +26 -0
- package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +12 -0
- package/build/components/UI/CAD/hooks/useOperationSequence.d.ts +29 -0
- package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +8 -0
- package/build/components/UI/CAD/hooks/useRoot.d.ts +2 -0
- package/build/components/UI/CAD/index.d.ts +27 -0
- package/build/components/UI/CAD/plugins/ProductManagement/ProdTable.d.ts +10 -0
- package/build/components/UI/CAD/plugins/ProductManagement/Root.d.ts +11 -0
- package/build/components/UI/CAD/plugins/ProductManagement/View.d.ts +11 -0
- package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +34 -0
- package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +4 -0
- package/build/components/UI/CAD/plugins/ProductManagement/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/plugins/SessionManagement/Root.d.ts +11 -0
- package/build/components/UI/CAD/plugins/SessionManagement/index.d.ts +36 -0
- package/build/components/UI/CAD/plugins/SessionManagement/types.d.ts +3 -0
- package/build/components/UI/CAD/store/CADActions.d.ts +29 -0
- package/build/components/UI/CAD/store/CADStore.d.ts +68 -0
- package/build/components/UI/CAD/store/instances.d.ts +7 -0
- package/build/components/UI/Readfile.d.ts +39 -0
- package/build/components/UI/ThemeVars.d.ts +6 -0
- package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +8 -0
- package/build/components/UI/editors/BooleanEditor/index.d.ts +2 -0
- package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +3 -0
- package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +11 -0
- package/build/components/UI/editors/CSysEditor/index.d.ts +2 -0
- package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +9 -0
- package/build/components/UI/editors/ColorEditor/ColorEditor.d.ts +12 -0
- package/build/components/UI/editors/ColorEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ColorEditor/useColorParam.d.ts +9 -0
- package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +20 -0
- package/build/components/UI/editors/ExpressionEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +5 -0
- package/build/components/UI/editors/NumberEditor/Inputs.d.ts +18 -0
- package/build/components/UI/editors/NumberEditor/Mentions.d.ts +10 -0
- package/build/components/UI/editors/NumberEditor/NumOrExpr.d.ts +12 -0
- package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +12 -0
- package/build/components/UI/editors/NumberEditor/index.d.ts +2 -0
- package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +5 -0
- package/build/components/UI/editors/PointEditor/PointEditor.d.ts +10 -0
- package/build/components/UI/editors/PointEditor/index.d.ts +2 -0
- package/build/components/UI/editors/PointEditor/usePointParam.d.ts +5 -0
- package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +12 -0
- package/build/components/UI/editors/RefsEditors/MateEditor.d.ts +13 -0
- package/build/components/UI/editors/RefsEditors/MateOrientationEditor.d.ts +9 -0
- package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +24 -0
- package/build/components/UI/editors/RefsEditors/RefsEditor.d.ts +16 -0
- package/build/components/UI/editors/RefsEditors/index.d.ts +8 -0
- package/build/components/UI/editors/RefsEditors/pickers.d.ts +4 -0
- package/build/components/UI/editors/RefsEditors/useIdParam.d.ts +3 -0
- package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +19 -0
- package/build/components/UI/editors/RefsEditors/useModes.d.ts +11 -0
- package/build/components/UI/editors/RefsEditors/useRefsParam.d.ts +3 -0
- package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +18 -0
- package/build/components/UI/editors/ToleranceEditor/ToleranceEditor.d.ts +7 -0
- package/build/components/UI/editors/ToleranceEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ToleranceEditor/useToleranceParam.d.ts +3 -0
- package/build/components/UI/editors/TypeEditor/TypeEditor.d.ts +10 -0
- package/build/components/UI/editors/TypeEditor/index.d.ts +2 -0
- package/build/components/UI/editors/TypeEditor/useTypeParam.d.ts +3 -0
- package/build/components/UI/editors/TypeWrapper.d.ts +6 -0
- package/build/components/UI/editors/Wrapper.d.ts +16 -0
- package/build/components/UI/editors/useParam.d.ts +20 -0
- package/build/components/UI/editors/useValidation.d.ts +4 -0
- package/build/components/graphics/Badge.d.ts +70 -0
- package/build/components/graphics/CSysDisplay.d.ts +108 -0
- package/build/components/graphics/CompositeCurveObj.d.ts +33 -0
- package/build/components/graphics/GeometryOverrides/GeometryOverridesManager.d.ts +41 -0
- package/build/components/graphics/GeometryOverrides/GeometryOverridesStore.d.ts +28 -0
- package/build/components/graphics/GeometryOverrides/index.d.ts +2 -0
- package/build/components/graphics/GeometryOverrides/useOverrideGeometryColor.d.ts +36 -0
- package/build/components/graphics/HUD.d.ts +44 -0
- package/build/components/graphics/HoveredConstraintDisplay.d.ts +24 -0
- package/build/components/graphics/InfinityPlane.d.ts +4 -0
- package/build/components/graphics/Outlines/AAPass.d.ts +8 -0
- package/build/components/graphics/Outlines/IDPass.d.ts +12 -0
- package/build/components/graphics/Outlines/Outline.d.ts +62 -0
- package/build/components/graphics/Outlines/OutlineEffect.d.ts +48 -0
- package/build/components/graphics/Outlines/OutlineMaterial.d.ts +9 -0
- package/build/components/graphics/Outlines/WidenPass.d.ts +17 -0
- package/build/components/graphics/PluginGeometryBounds.d.ts +40 -0
- package/build/components/graphics/SelectableMate.d.ts +3 -0
- package/build/components/graphics/SelectedMateObj.d.ts +54 -0
- package/build/components/graphics/StageLook.d.ts +51 -0
- package/build/components/graphics/WorkAxisObj.d.ts +33 -0
- package/build/components/graphics/WorkCSysObj.d.ts +33 -0
- package/build/components/graphics/WorkCoordSystemObj.d.ts +32 -0
- package/build/components/graphics/WorkPlaneObj.d.ts +33 -0
- package/build/components/graphics/WorkPointObj.d.ts +57 -0
- package/build/components/graphics/graphics.d.ts +61 -0
- package/build/components/graphics/utils/MatePathTransform.d.ts +10 -0
- package/build/components/graphics/utils/useCsysMatrix.d.ts +4 -0
- package/build/components/utils/CompValidation/ErrorBoundary.d.ts +28 -0
- package/build/components/utils/CompValidation/validators/CSysDisplayValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/DrawingValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/ExpressionsValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/FPluginValidator.d.ts +16 -0
- package/build/components/utils/CompValidation/validators/FeatureListValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/ProductManagementValidator.d.ts +14 -0
- package/build/components/utils/CompValidation/verifiers.d.ts +32 -0
- package/build/components/utils/FtVisibilityController.d.ts +26 -0
- package/build/elements/index.d.ts +162 -0
- package/build/icons/axes.d.ts +73 -0
- package/build/icons/draw.d.ts +75 -0
- package/build/icons/features.d.ts +71 -0
- package/build/icons/glyphs.d.ts +10 -0
- package/build/icons/index.d.ts +152 -0
- package/build/icons/legacy.d.ts +159 -0
- package/build/icons/mates.d.ts +26 -0
- package/build/icons/params.d.ts +77 -0
- package/build/icons/refs.d.ts +61 -0
- package/build/icons/sheets.d.ts +302 -0
- package/build/icons/sketch.d.ts +102 -0
- package/build/icons/types.d.ts +74 -0
- package/build/icons/ui.d.ts +114 -0
- package/build/icons.cjs.js +1751 -0
- package/build/icons.js +1742 -0
- package/build/index.cjs.js +44948 -0
- package/build/index.d.ts +115 -0
- package/build/index.js +44800 -0
- package/build/plugins/AppearanceEditor/Root.d.ts +12 -0
- package/build/plugins/AppearanceEditor/index.d.ts +42 -0
- package/build/plugins/Boolean/Root.d.ts +11 -0
- package/build/plugins/Boolean/index.d.ts +39 -0
- package/build/plugins/BoundingBoxInfo/Root.d.ts +12 -0
- package/build/plugins/BoundingBoxInfo/View.d.ts +11 -0
- package/build/plugins/BoundingBoxInfo/index.d.ts +35 -0
- package/build/plugins/Box/Root.d.ts +11 -0
- package/build/plugins/Box/index.d.ts +34 -0
- package/build/plugins/Chamfer/Root.d.ts +11 -0
- package/build/plugins/Chamfer/index.d.ts +35 -0
- package/build/plugins/CircularPattern/Root.d.ts +11 -0
- package/build/plugins/CircularPattern/index.d.ts +35 -0
- package/build/plugins/CompositeCurve/Root.d.ts +11 -0
- package/build/plugins/CompositeCurve/View.d.ts +11 -0
- package/build/plugins/CompositeCurve/index.d.ts +36 -0
- package/build/plugins/Cone/Root.d.ts +11 -0
- package/build/plugins/Cone/index.d.ts +36 -0
- package/build/plugins/Cylinder/Root.d.ts +11 -0
- package/build/plugins/Cylinder/index.d.ts +35 -0
- package/build/plugins/Dimensions/DimContext.d.ts +10 -0
- package/build/plugins/Dimensions/Root.d.ts +11 -0
- package/build/plugins/Dimensions/View.d.ts +11 -0
- package/build/plugins/Dimensions/graphics/DimGraphics.d.ts +7 -0
- package/build/plugins/Dimensions/graphics/DimensionSet.d.ts +8 -0
- package/build/plugins/Dimensions/graphics/primitives.d.ts +34 -0
- package/build/plugins/Dimensions/index.d.ts +34 -0
- package/build/plugins/Dimensions/utils.d.ts +5 -0
- package/build/plugins/EntityDeletion/Root.d.ts +11 -0
- package/build/plugins/EntityDeletion/index.d.ts +34 -0
- package/build/plugins/Expressions/Root.d.ts +11 -0
- package/build/plugins/Expressions/index.d.ts +34 -0
- package/build/plugins/Expressions/useContextMenuItems.d.ts +4 -0
- package/build/plugins/Extrusion/Root.d.ts +11 -0
- package/build/plugins/Extrusion/View.d.ts +11 -0
- package/build/plugins/Extrusion/index.d.ts +50 -0
- package/build/plugins/Fillet/Root.d.ts +11 -0
- package/build/plugins/Fillet/index.d.ts +35 -0
- package/build/plugins/HLConstraints/CircularPattern/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/CircularPattern/View.d.ts +11 -0
- package/build/plugins/HLConstraints/CircularPattern/index.d.ts +38 -0
- package/build/plugins/HLConstraints/Cylindrical/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Cylindrical/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Cylindrical/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Fastened/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Fastened/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Fastened/index.d.ts +37 -0
- package/build/plugins/HLConstraints/FastenedOrigin/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/FastenedOrigin/View.d.ts +11 -0
- package/build/plugins/HLConstraints/FastenedOrigin/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Gear/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Gear/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Gear/index.d.ts +36 -0
- package/build/plugins/HLConstraints/Group/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Group/index.d.ts +34 -0
- package/build/plugins/HLConstraints/LinearPattern/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/LinearPattern/View.d.ts +11 -0
- package/build/plugins/HLConstraints/LinearPattern/index.d.ts +38 -0
- package/build/plugins/HLConstraints/Parallel/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Parallel/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Parallel/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Planar/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Planar/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Planar/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Revolute/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Revolute/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Revolute/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Slider/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Slider/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Slider/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Spherical/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Spherical/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Spherical/index.d.ts +36 -0
- package/build/plugins/HLConstraints/components/CSysDisplayWrapper.d.ts +7 -0
- package/build/plugins/HLConstraints/components/HLConstrIcon.d.ts +7 -0
- package/build/plugins/HLConstraints/components/LimitedValue.d.ts +12 -0
- package/build/plugins/HLConstraints/components/Limits.d.ts +25 -0
- package/build/plugins/HLConstraints/components/LimitsCollapse.d.ts +12 -0
- package/build/plugins/HLConstraints/validators.d.ts +2 -0
- package/build/plugins/Import/Root.d.ts +11 -0
- package/build/plugins/Import/index.d.ts +35 -0
- package/build/plugins/LinearPattern/Root.d.ts +11 -0
- package/build/plugins/LinearPattern/index.d.ts +36 -0
- package/build/plugins/Measure/Digits.d.ts +7 -0
- package/build/plugins/Measure/Root.d.ts +11 -0
- package/build/plugins/Measure/View.d.ts +15 -0
- package/build/plugins/Measure/config.d.ts +1 -0
- package/build/plugins/Measure/graphics/MeasureGraphics.d.ts +24 -0
- package/build/plugins/Measure/index.d.ts +39 -0
- package/build/plugins/Measure/utils.d.ts +2 -0
- package/build/plugins/Mirror/Root.d.ts +11 -0
- package/build/plugins/Mirror/index.d.ts +34 -0
- package/build/plugins/Revolve/Root.d.ts +11 -0
- package/build/plugins/Revolve/index.d.ts +37 -0
- package/build/plugins/Rotate/Root.d.ts +11 -0
- package/build/plugins/Rotate/index.d.ts +35 -0
- package/build/plugins/Sketch/Root/Constraints/Constraints.d.ts +2 -0
- package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +22 -0
- package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
- package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
- package/build/plugins/Sketch/Root/CopyPatterns.d.ts +2 -0
- package/build/plugins/Sketch/Root/Details.d.ts +2 -0
- package/build/plugins/Sketch/Root/Handlers.d.ts +2 -0
- package/build/plugins/Sketch/Root/PlaneSelection.d.ts +7 -0
- package/build/plugins/Sketch/Root/Position.d.ts +2 -0
- package/build/plugins/Sketch/Root/Regions.d.ts +2 -0
- package/build/plugins/Sketch/Root/Root.d.ts +11 -0
- package/build/plugins/Sketch/Root/RootContext.d.ts +7 -0
- package/build/plugins/Sketch/Root/SketchGroup.d.ts +15 -0
- package/build/plugins/Sketch/Root/index.d.ts +1 -0
- package/build/plugins/Sketch/Root/useContextMenuItems.d.ts +4 -0
- package/build/plugins/Sketch/Root/useLayoutSize.d.ts +11 -0
- package/build/plugins/Sketch/View/View.d.ts +11 -0
- package/build/plugins/Sketch/View/ViewContext.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/Constraints.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/IconGroups.d.ts +7 -0
- package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +20 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/Bezier.d.ts +19 -0
- package/build/plugins/Sketch/View/graphics/Merged/BezierGeometry.d.ts +12 -0
- package/build/plugins/Sketch/View/graphics/Merged/BezierMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +9 -0
- package/build/plugins/Sketch/View/graphics/Merged/Line.d.ts +15 -0
- package/build/plugins/Sketch/View/graphics/Merged/LineGeometry.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/LineMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +16 -0
- package/build/plugins/Sketch/View/graphics/Merged/Point.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/Merged/Spline.d.ts +17 -0
- package/build/plugins/Sketch/View/graphics/Merged/SplineGeometry.d.ts +11 -0
- package/build/plugins/Sketch/View/graphics/Merged/SplineMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/MousePosition.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Regions.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/TmpAngularDimension.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/graphics.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +49 -0
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +34 -0
- package/build/plugins/Sketch/View/graphics/scale.d.ts +6 -0
- package/build/plugins/Sketch/View/graphics/tmpGraphics.d.ts +3 -0
- package/build/plugins/Sketch/View/graphics/transform.d.ts +4 -0
- package/build/plugins/Sketch/View/handlers/CreateAngle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/CreateConstraint.d.ts +10 -0
- package/build/plugins/Sketch/View/handlers/Drag.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawArc.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawCircle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawLine.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawNurbs.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawPoint.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawRectangle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Fillet.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +33 -0
- package/build/plugins/Sketch/View/handlers/Hover.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/SSelect.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Split.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Trim.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Use.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/constraintCreation.d.ts +10 -0
- package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +24 -0
- package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/snapper.d.ts +11 -0
- package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +20 -0
- package/build/plugins/Sketch/View/index.d.ts +1 -0
- package/build/plugins/Sketch/constants.d.ts +5 -0
- package/build/plugins/Sketch/description.d.ts +7 -0
- package/build/plugins/Sketch/index.d.ts +35 -0
- package/build/plugins/Sketch/resources.d.ts +5 -0
- package/build/plugins/Sketch/types.d.ts +148 -0
- package/build/plugins/Sketch/utils/Interaction.d.ts +7 -0
- package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
- package/build/plugins/Sketch/utils/getSketchState.d.ts +3 -0
- package/build/plugins/Sketch/utils/useSketchRegions.d.ts +2 -0
- package/build/plugins/Sketch/utils/useSketchState.d.ts +3 -0
- package/build/plugins/Slice/Root.d.ts +11 -0
- package/build/plugins/Slice/index.d.ts +34 -0
- package/build/plugins/SliceBySheet/Root.d.ts +11 -0
- package/build/plugins/SliceBySheet/index.d.ts +35 -0
- package/build/plugins/Sphere/Root.d.ts +11 -0
- package/build/plugins/Sphere/index.d.ts +35 -0
- package/build/plugins/TransformByCsys/Root.d.ts +11 -0
- package/build/plugins/TransformByCsys/index.d.ts +35 -0
- package/build/plugins/Translate/Root.d.ts +11 -0
- package/build/plugins/Translate/index.d.ts +35 -0
- package/build/plugins/Twist/Root.d.ts +11 -0
- package/build/plugins/Twist/View.d.ts +11 -0
- package/build/plugins/Twist/index.d.ts +48 -0
- package/build/plugins/WorkAxis/Root.d.ts +11 -0
- package/build/plugins/WorkAxis/View.d.ts +11 -0
- package/build/plugins/WorkAxis/index.d.ts +37 -0
- package/build/plugins/WorkCSys/Root.d.ts +11 -0
- package/build/plugins/WorkCSys/View.d.ts +11 -0
- package/build/plugins/WorkCSys/index.d.ts +53 -0
- package/build/plugins/WorkCoordSystem/Root.d.ts +11 -0
- package/build/plugins/WorkCoordSystem/View.d.ts +11 -0
- package/build/plugins/WorkCoordSystem/index.d.ts +55 -0
- package/build/plugins/WorkPlane/Root.d.ts +11 -0
- package/build/plugins/WorkPlane/View.d.ts +11 -0
- package/build/plugins/WorkPlane/index.d.ts +38 -0
- package/build/plugins/WorkPlane/validators.d.ts +1 -0
- package/build/plugins/WorkPoint/Root.d.ts +11 -0
- package/build/plugins/WorkPoint/View.d.ts +11 -0
- package/build/plugins/WorkPoint/index.d.ts +38 -0
- package/build/plugins/components/PluginForm.d.ts +24 -0
- package/build/plugins/utils/useRefsReset.d.ts +2 -0
- package/build/session/identity.d.ts +46 -0
- package/build/session/sessionClient.d.ts +140 -0
- package/build/session/types.d.ts +52 -0
- package/build/session/viewpoints.d.ts +90 -0
- package/build/theme/AppStyle.d.ts +33 -0
- package/build/theme/fonts/mono.d.ts +29 -0
- package/build/theme/stage.d.ts +148 -0
- package/build/theme/styles/antdChoices.d.ts +1 -0
- package/build/theme/styles/antdControls.d.ts +1 -0
- package/build/theme/styles/antdSurfaces.d.ts +1 -0
- package/build/theme/styles/editors.d.ts +1 -0
- package/build/theme/styles/fields.d.ts +1 -0
- package/build/theme/styles/frame.d.ts +1 -0
- package/build/theme/styles/panes.d.ts +1 -0
- package/build/theme/styles/parts.d.ts +2 -0
- package/build/theme/styles/rest.d.ts +1 -0
- package/build/theme/styles/sketch.d.ts +1 -0
- package/build/theme/styles/toolbar.d.ts +1 -0
- package/build/theme/styles/tools.d.ts +1 -0
- package/build/theme/styles/windows.d.ts +1 -0
- package/build/theme/themeStore.d.ts +305 -0
- package/build/types/jsx-compat.d.ts +8 -0
- package/build/types.d.ts +16 -0
- package/build/utils/FileUtils.d.ts +20 -0
- package/build/utils/bezierMatrices.d.ts +3 -0
- package/build/utils/conversionUtils.d.ts +78 -0
- package/build/utils/cubicSplineInterpolation.d.ts +5 -0
- package/build/utils/defaultValues.d.ts +3 -0
- package/build/utils/drawing/index.d.ts +3 -0
- package/build/utils/drawing/useDrawingArr.d.ts +10 -0
- package/build/utils/drawing/useDrawingCCId.d.ts +10 -0
- package/build/utils/drawing/useDrawingStr.d.ts +10 -0
- package/build/utils/getHighlightedColor.d.ts +6 -0
- package/build/utils/getMatePath.d.ts +2 -0
- package/build/utils/getMateRefIds.d.ts +30 -0
- package/build/utils/helpers.d.ts +19 -0
- package/build/utils/mateUtils.d.ts +35 -0
- package/build/utils/nurbsUtils.d.ts +35 -0
- package/build/utils/selection/filters.d.ts +12 -0
- package/build/utils/selection/scopes/mateSelection.d.ts +49 -0
- package/build/utils/selection/scopes/treeObjInteraction.d.ts +74 -0
- package/build/utils/selection/useSelectorsOrder.d.ts +12 -0
- package/build/utils/sketchIntersectionUtils.d.ts +139 -0
- package/build/utils/sketchUtils.d.ts +235 -0
- package/build/utils/useAllObjects.d.ts +31 -0
- package/build/utils/useIsUncommited.d.ts +2 -0
- package/build/utils/useRetainVisibility.d.ts +2 -0
- package/build/utils/useScale.d.ts +5 -0
- package/build/utils/validation.d.ts +11 -0
- package/doc/api/advanced/session.md +646 -0
- package/doc/api/advanced/utilities.md +1306 -0
- package/doc/api/assembly-constraints.md +340 -0
- package/doc/api/feature-plugins.md +613 -0
- package/doc/api/graphics.md +848 -0
- package/doc/api/hooks.md +300 -0
- package/doc/api/icons.md +812 -0
- package/doc/api/index.md +87 -0
- package/doc/api/other.md +369 -0
- package/doc/api/panels.md +754 -0
- package/doc/api/theme.md +551 -0
- package/doc/api/tool-plugins.md +191 -0
- package/doc/api/ui-elements.md +310 -0
- package/doc/api/work-geometry.md +154 -0
- package/icons/package.json +8 -0
- package/package.json +108 -4
- package/tools/fonts/brotli.py +29 -0
- package/tools/fonts/build.py +76 -0
- package/tools/icons/preview.mjs +74 -0
- package/tsconfig.build.json +16 -0
- package/typedoc.json +18 -0
- package/vitest.config.mts +25 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Tool Plugins
|
|
2
|
+
|
|
3
|
+
The tools every drawing has, each in a window of its own: measuring, the bounding box, 3D dimensions, expressions,
|
|
4
|
+
appearance, products and sessions. An app lists them in `init`'s `globalPlugins`; react-cad opens them from the
|
|
5
|
+
stage's buttons, the toolbar, the model tree's header and a solid's context menu.
|
|
6
|
+
|
|
7
|
+
## Plugins
|
|
8
|
+
|
|
9
|
+
### Measure {#measure}
|
|
10
|
+
|
|
11
|
+
Measures the model: a picked item is read (positions, axes, lengths, radii), two are measured against each other.
|
|
12
|
+
|
|
13
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one, and the
|
|
14
|
+
`ViewPlugButtons` have a button that opens it. Its window is one of the `GlobalPlugins`. The panel picks the items
|
|
15
|
+
and sets the number of digits; between two items it gives their distance and angle. What was measured is drawn in the
|
|
16
|
+
scene as well.
|
|
17
|
+
|
|
18
|
+
#### Example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { init, WASMClient } from '@classcad/client'
|
|
22
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
23
|
+
import { elements, Measure } from '@classcad/react-cad'
|
|
24
|
+
|
|
25
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [Measure] })
|
|
26
|
+
|
|
27
|
+
// Code opens it by its name, as its button in the `ViewPlugButtons` does:
|
|
28
|
+
const drawing = getDrawing(drawingId)
|
|
29
|
+
const measureId = drawing.plugin.global.find(id => drawing.plugin.refs[id].name === 'Measure')
|
|
30
|
+
if (measureId) drawing.api.plugin.setActiveGlobal(measureId, true)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### Expressions {#expressions}
|
|
36
|
+
|
|
37
|
+
Lists and edits the current product's expressions: their names, expressions and values.
|
|
38
|
+
|
|
39
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one, and react-cad's
|
|
40
|
+
toolbar opens it with its Expressions command. Its window is one of the `GlobalPlugins`. The panel searches the
|
|
41
|
+
expressions, adds one from a name and an expression, renames and deletes them, and Apply sends the edited ones
|
|
42
|
+
(`part.updateExpression`). The panel stays open; it does not update while a feature's dialog is open.
|
|
43
|
+
|
|
44
|
+
#### Example
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { init, WASMClient } from '@classcad/client'
|
|
48
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
49
|
+
import { elements, Expressions } from '@classcad/react-cad'
|
|
50
|
+
|
|
51
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [Expressions] })
|
|
52
|
+
|
|
53
|
+
// Code opens it by its name, as the toolbar's Expressions command does:
|
|
54
|
+
const drawing = getDrawing(drawingId)
|
|
55
|
+
const expressionsId = drawing.plugin.global.find(id => drawing.plugin.refs[id].name === 'Expressions')
|
|
56
|
+
if (expressionsId) drawing.api.plugin.setActiveGlobal(expressionsId, true)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### ProductManagement {#productmanagement}
|
|
62
|
+
|
|
63
|
+
The Products panel: the parts and assemblies of the drawing, to create, import, rename, edit, export, delete, and
|
|
64
|
+
add to the current assembly.
|
|
65
|
+
|
|
66
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one; the model tree's
|
|
67
|
+
header opens it (the products button), and its window is one of the [GlobalPlugins](panels.md#globalplugins). Its tabs list the parts
|
|
68
|
+
and the assemblies; a product is added to the current assembly as an instance where it is placed on the stage.
|
|
69
|
+
|
|
70
|
+
#### Example
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { init, WASMClient } from '@classcad/client'
|
|
74
|
+
import { elements, Measure, ProductManagement } from '@classcad/react-cad'
|
|
75
|
+
|
|
76
|
+
// every drawing gets the Products panel; the model tree's header opens it
|
|
77
|
+
init((drawingId) => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
78
|
+
elements,
|
|
79
|
+
globalPlugins: [Measure, ProductManagement],
|
|
80
|
+
})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### AppearanceEditor {#appearanceeditor}
|
|
86
|
+
|
|
87
|
+
Edits the appearance of solids: their color and transparency, and the tolerances they are tessellated with.
|
|
88
|
+
|
|
89
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one, and react-cad opens
|
|
90
|
+
it with Edit appearance in a solid's context menu, for the selected solids and the one clicked. An app opens it the
|
|
91
|
+
same way: it sets the plugin's state `solidIds` and activates it (`setActiveGlobal`). Its window is one of the
|
|
92
|
+
`GlobalPlugins`. Apply sets the appearance (`common.setAppearance`).
|
|
93
|
+
|
|
94
|
+
#### Example
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { init, WASMClient } from '@classcad/client'
|
|
98
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
99
|
+
import { AppearanceEditor, elements } from '@classcad/react-cad'
|
|
100
|
+
|
|
101
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [AppearanceEditor] })
|
|
102
|
+
|
|
103
|
+
// Code opens it as Edit appearance in a solid's context menu does: it gives the plugin the solids, here all of the
|
|
104
|
+
// current product's, and activates it:
|
|
105
|
+
const drawing = getDrawing(drawingId)
|
|
106
|
+
const editorId = drawing.plugin.global.find(id => drawing.plugin.refs[id].name === 'Appearance Editor')
|
|
107
|
+
if (editorId) {
|
|
108
|
+
const product = drawing.structure.tree[drawing.structure.currentProduct!]
|
|
109
|
+
drawing.plugin.refs[editorId].set({ solidIds: product.solids })
|
|
110
|
+
drawing.api.plugin.setActiveGlobal(editorId, true)
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
***
|
|
115
|
+
|
|
116
|
+
### BoundingBoxInfo {#boundingboxinfo}
|
|
117
|
+
|
|
118
|
+
Shows the model's bounding box: its extents along X, Y and Z, and optionally its axes and boundaries in the scene.
|
|
119
|
+
|
|
120
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one, and the
|
|
121
|
+
`ViewPlugButtons` have a button that opens it. Its window is one of the `GlobalPlugins`. The panel lists the minimum,
|
|
122
|
+
the maximum and the size along each axis, and switches on, in the scene, the orientation (axes with marks around the
|
|
123
|
+
model) and the boundaries.
|
|
124
|
+
|
|
125
|
+
#### Example
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { init, WASMClient } from '@classcad/client'
|
|
129
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
130
|
+
import { BoundingBoxInfo, elements } from '@classcad/react-cad'
|
|
131
|
+
|
|
132
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [BoundingBoxInfo] })
|
|
133
|
+
|
|
134
|
+
// Code opens it by its name, as its button in the `ViewPlugButtons` does:
|
|
135
|
+
const drawing = getDrawing(drawingId)
|
|
136
|
+
const boxInfoId = drawing.plugin.global.find(id => drawing.plugin.refs[id].name === 'BoundingBoxInfo')
|
|
137
|
+
if (boxInfoId) drawing.api.plugin.setActiveGlobal(boxInfoId, true)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
***
|
|
141
|
+
|
|
142
|
+
### Dimensions {#dimensions}
|
|
143
|
+
|
|
144
|
+
Shows the 3D dimensions of the current product in the scene, and switches them on and off.
|
|
145
|
+
|
|
146
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, which gives every drawing one, and the
|
|
147
|
+
`ViewPlugButtons` have a button that opens it. Its window is one of the `GlobalPlugins`. Its view draws the product's
|
|
148
|
+
dimension set (`CC_DimensionSet`); the panel has the switch.
|
|
149
|
+
|
|
150
|
+
#### Example
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { init, WASMClient } from '@classcad/client'
|
|
154
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
155
|
+
import { Dimensions, elements } from '@classcad/react-cad'
|
|
156
|
+
|
|
157
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [Dimensions] })
|
|
158
|
+
|
|
159
|
+
// Code opens it by its name, as its button in the `ViewPlugButtons` does:
|
|
160
|
+
const drawing = getDrawing(drawingId)
|
|
161
|
+
const dimensionsId = drawing.plugin.global.find(id => drawing.plugin.refs[id].name === 'Dimensions')
|
|
162
|
+
if (dimensionsId) drawing.api.plugin.setActiveGlobal(dimensionsId, true)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Advanced
|
|
166
|
+
|
|
167
|
+
Most apps do not need these directly: types they meet through the exports above, and what is there for special cases or for building on buerli itself.
|
|
168
|
+
|
|
169
|
+
### SessionManagement {#sessionmanagement}
|
|
170
|
+
|
|
171
|
+
The Sessions panel: the host of a shared session makes invites to it, sees who has joined, and copies or revokes
|
|
172
|
+
their links.
|
|
173
|
+
|
|
174
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins` (Buerligons does so where sharing is on), and the
|
|
175
|
+
[ViewPlugButtons](panels.md#viewplugbuttons) have a button that opens it. It shows only for the host of a session that can be shared (a
|
|
176
|
+
`WSClient` or a `WASMClient` registered with `sessionClient.setSessionClient`), not to a guest. An invite has a
|
|
177
|
+
name and a role (edit or view); its link opens the app as a guest of the session.
|
|
178
|
+
|
|
179
|
+
#### Example
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { init, onClient, WASMClient } from '@classcad/client'
|
|
183
|
+
import { elements, sessionClient, SessionManagement } from '@classcad/react-cad'
|
|
184
|
+
|
|
185
|
+
// the page hosts the session itself; its Sessions panel hands out invites to it
|
|
186
|
+
init((drawingId) => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
187
|
+
elements,
|
|
188
|
+
globalPlugins: [SessionManagement],
|
|
189
|
+
})
|
|
190
|
+
onClient((client) => sessionClient.setSessionClient(client))
|
|
191
|
+
```
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# UI Elements
|
|
2
|
+
|
|
3
|
+
The form controls of the dialogs in the app's look, which an app passes to `init`; and menus.
|
|
4
|
+
|
|
5
|
+
## Objects
|
|
6
|
+
|
|
7
|
+
### elements {#elements}
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const elements: {
|
|
11
|
+
Alert: (__namedParameters) => Element;
|
|
12
|
+
AutoComplete: (__namedParameters) => Element;
|
|
13
|
+
Button: (__namedParameters) => Element;
|
|
14
|
+
ButtonGroup: (__namedParameters) => Element;
|
|
15
|
+
Checkbox: (__namedParameters) => Element;
|
|
16
|
+
Collapse: (__namedParameters) => Element;
|
|
17
|
+
Dropdown: (__namedParameters) => Element;
|
|
18
|
+
Group: (__namedParameters) => Element;
|
|
19
|
+
Input: ForwardRefExoticComponent<InputProps & RefAttributes<InputRef>>;
|
|
20
|
+
Label: (__namedParameters) => Element;
|
|
21
|
+
Mentions: MentionsT;
|
|
22
|
+
Menu: (__namedParameters) => Element;
|
|
23
|
+
MenuItem: (__namedParameters) => Element;
|
|
24
|
+
Select: ForwardRefExoticComponent<{
|
|
25
|
+
children?: any[];
|
|
26
|
+
} & SelectProps<any, DefaultOptionType> & RefAttributes<BaseSelectRef>>;
|
|
27
|
+
Selection: (__namedParameters) => Element;
|
|
28
|
+
Slider: (__namedParameters) => Element;
|
|
29
|
+
TabPane: (__namedParameters) => Element;
|
|
30
|
+
Tabs: (__namedParameters) => Element;
|
|
31
|
+
Tooltip: (props) => Element;
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The form controls the feature dialogs are made of, in the app's look: react-cad's set of buerli's `elements`.
|
|
36
|
+
|
|
37
|
+
They take the place of the ones `@classcad/react` ships, prop for prop: plugins take their controls from `init`'s
|
|
38
|
+
`elements` option, so an app passes these there. [Drawing](panels.md#drawing) does so by itself where the app left the stock
|
|
39
|
+
ones in; an app that brought controls of its own keeps them. They are antd's controls, styled by the app's
|
|
40
|
+
stylesheet ([AppStyle](theme.md#appstyle)).
|
|
41
|
+
|
|
42
|
+
#### Type Declaration
|
|
43
|
+
|
|
44
|
+
| Name | Type | Description |
|
|
45
|
+
| :------ | :------ | :------ |
|
|
46
|
+
| <a id="property-alert"></a> `Alert()` | (`__namedParameters`) => `Element` | A message box (antd `Alert`). |
|
|
47
|
+
| <a id="property-autocomplete"></a> `AutoComplete()` | (`__namedParameters`) => `Element` | A text input with suggestions (antd `AutoComplete`). |
|
|
48
|
+
| <a id="property-button"></a> `Button()` | (`__namedParameters`) => `Element` | A button (antd `Button`); with `iconSrc`, a small one with an icon, and with `titleText`, a tooltip. |
|
|
49
|
+
| <a id="property-buttongroup"></a> `ButtonGroup()` | (`__namedParameters`) => `Element` | Buttons side by side. |
|
|
50
|
+
| <a id="property-checkbox"></a> `Checkbox()` | (`__namedParameters`) => `Element` | A checkbox (antd `Checkbox`). |
|
|
51
|
+
| <a id="property-collapse"></a> `Collapse()` | (`__namedParameters`) => `Element` | A section that opens and closes (antd `Collapse`), open while `isActive`. |
|
|
52
|
+
| <a id="property-dropdown"></a> `Dropdown()` | (`__namedParameters`) => `Element` | A dropdown menu (antd `Dropdown`). |
|
|
53
|
+
| <a id="property-group"></a> `Group()` | (`__namedParameters`) => `Element` | A row (or, with `format="Columns"`, a column) of controls. |
|
|
54
|
+
| <a id="property-input"></a> `Input` | `ForwardRefExoticComponent`<`InputProps` & `RefAttributes`<`InputRef`>> | A text or number input (antd `Input`). |
|
|
55
|
+
| <a id="property-label"></a> `Label()` | (`__namedParameters`) => `Element` | A label in front of a control; `highlighted` marks a value that was changed. |
|
|
56
|
+
| <a id="property-mentions"></a> `Mentions` | `MentionsT` | A text input with suggestions after a prefix such as `@` (antd `Mentions`), for expressions. |
|
|
57
|
+
| <a id="property-menu"></a> `Menu()` | (`__namedParameters`) => `Element` | A menu (antd `Menu`). |
|
|
58
|
+
| <a id="property-menuitem"></a> `MenuItem()` | (`__namedParameters`) => `Element` | An entry of [elements](#elements).Menu. |
|
|
59
|
+
| <a id="property-select"></a> `Select` | `ForwardRefExoticComponent`<\{ `children?`: `any`[]; \} & `SelectProps`<`any`, `DefaultOptionType`> & `RefAttributes`<`BaseSelectRef`>> | A dropdown to choose from (antd `Select`); its children are the options, as strings. |
|
|
60
|
+
| <a id="property-selection"></a> `Selection()` | (`__namedParameters`) => `Element` | The well a reference is picked into: a field that shows what its selector has selected, as chips. A click makes it listen (its selector is the drawing's active one): its ring turns red, and what is clicked on the stage or in the tree goes into it. While it listens, a click on one of its chips takes that one out again. While it is empty it says its `caption`, or the [FieldContext](#fieldcontext)'s hint. The well a reference is picked into. A click makes it listen: its ring turns red, and what is clicked on the stage or in the tree goes into it. While it listens, a click on one of its chips takes that one out again. |
|
|
61
|
+
| <a id="property-slider"></a> `Slider()` | (`__namedParameters`) => `Element` | A slider (antd `Slider`). |
|
|
62
|
+
| <a id="property-tabpane"></a> `TabPane()` | (`__namedParameters`) => `Element` | A tab of [elements](#elements).Tabs. |
|
|
63
|
+
| <a id="property-tabs"></a> `Tabs()` | (`__namedParameters`) => `Element` | Tabs (antd `Tabs`). |
|
|
64
|
+
| <a id="property-tooltip"></a> `Tooltip()` | (`props`) => `Element` | A tooltip (antd `Tooltip`). |
|
|
65
|
+
|
|
66
|
+
#### Example
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import type { TooltipProps } from 'antd'
|
|
70
|
+
import { init, WASMClient } from '@classcad/client'
|
|
71
|
+
import { elements } from '@classcad/react-cad'
|
|
72
|
+
|
|
73
|
+
// the feature dialogs in the app's look; with a control of the app's own in place of one of them
|
|
74
|
+
init((drawingId) => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
75
|
+
elements: { ...elements, Tooltip: (props: TooltipProps) => <elements.Tooltip {...props} mouseEnterDelay={0.6} /> },
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Components
|
|
80
|
+
|
|
81
|
+
### ContextMenu {#contextmenu}
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const ContextMenu: React.FC<ContextMenuProps>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The menu on a thing: its head says what the thing is, its entries what can be done with it.
|
|
88
|
+
|
|
89
|
+
It is antd's `Dropdown` around its children, which open it as its `trigger` says (`['contextMenu']` for a right
|
|
90
|
+
click). The entries' handlers are called with the `menuInfo`, so one list of entries serves every thing of a kind;
|
|
91
|
+
a submenu's entries may be made when it opens. While it is open, a blank layer over the app (which [Drawing](panels.md#drawing)
|
|
92
|
+
renders) takes the click beside it that closes it. Its props: [ContextMenuProps](#contextmenuprops).
|
|
93
|
+
|
|
94
|
+
#### Example
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { createInfo, getDrawing } from '@classcad/sdkjs'
|
|
98
|
+
import type { DrawingID, ObjectID } from '@classcad/sdkjs'
|
|
99
|
+
import { ContextMenu, Icon } from '@classcad/react-cad'
|
|
100
|
+
import type { MenuElement } from '@classcad/react-cad'
|
|
101
|
+
|
|
102
|
+
// one list of entries for every row of a list of the app's: the handlers are told which object the menu is on
|
|
103
|
+
const rowMenu = (drawingId: DrawingID): MenuElement[] => [
|
|
104
|
+
{ key: 'select', label: 'Select', onClick: ({ interactionInfo }) => getDrawing(drawingId).api.interaction.select(interactionInfo) },
|
|
105
|
+
{ type: 'divider' },
|
|
106
|
+
{ key: 'hide', label: 'Hide', onClick: ({ interactionInfo }) => getDrawing(drawingId).api.plugin.setVisiblePlugin(interactionInfo.objectId, false) },
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
const Row = ({ drawingId, objectId, name }: { drawingId: DrawingID; objectId: ObjectID; name: string }) => (
|
|
110
|
+
<ContextMenu items={rowMenu(drawingId)} menuInfo={{ interactionInfo: createInfo({ objectId }) }}
|
|
111
|
+
caption={name} icon={<Icon name="workPlane" size={16} />} trigger={['contextMenu']}>
|
|
112
|
+
<div>{name}</div>
|
|
113
|
+
</ContextMenu>
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
***
|
|
118
|
+
|
|
119
|
+
### Menu {#menu}
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
const Menu: React.FC<RCadMenuProps>;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
A dropdown menu on a button: by default a small button with three dots, or what is given as its children.
|
|
126
|
+
|
|
127
|
+
It is antd's `Dropdown`, with the [MenuItems](#menuitems) as its entries; an entry with `children` opens a submenu. A click
|
|
128
|
+
on an entry calls its `callback`, and does not reach what lies under the menu. Its props: [RCadMenuProps](#rcadmenuprops).
|
|
129
|
+
|
|
130
|
+
#### Example
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { createApi } from '@classcad/client'
|
|
134
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
135
|
+
import { Icon, Menu } from '@classcad/react-cad'
|
|
136
|
+
import type { MenuItems } from '@classcad/react-cad'
|
|
137
|
+
|
|
138
|
+
// a file menu: a button with its icon, and a submenu of the formats
|
|
139
|
+
function FileMenu({ drawingId }: { drawingId: DrawingID }) {
|
|
140
|
+
const save = (format: 'STP' | 'STL' | 'OFB') => createApi(drawingId).v1.common.save({ format, encoding: 'base64' })
|
|
141
|
+
const items: MenuItems = {
|
|
142
|
+
clear: { caption: 'New', icon: <Icon name="file" size={16} />, callback: () => createApi(drawingId).v1.common.clear() },
|
|
143
|
+
save: {
|
|
144
|
+
caption: 'Save as',
|
|
145
|
+
icon: <Icon name="export" size={16} />,
|
|
146
|
+
children: { stp: { caption: 'STEP', callback: () => save('STP') }, stl: { caption: 'STL', callback: () => save('STL') } },
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
return (
|
|
150
|
+
<Menu items={items} trigger={['click']}>
|
|
151
|
+
<button className="rcad-tool"><Icon name="menu" size={18} /></button>
|
|
152
|
+
</Menu>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Types
|
|
158
|
+
|
|
159
|
+
### ContextMenuProps {#contextmenuprops}
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
type ContextMenuProps = {
|
|
163
|
+
caption: string;
|
|
164
|
+
icon?: React.JSX.Element;
|
|
165
|
+
items: MenuElement[];
|
|
166
|
+
menuInfo: MenuInfo<any>;
|
|
167
|
+
onHide?: () => void;
|
|
168
|
+
} & DropDownProps;
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Props of [ContextMenu](#contextmenu), and any of antd's `Dropdown` props (`trigger`, `open`, …).
|
|
172
|
+
|
|
173
|
+
#### Type Declaration
|
|
174
|
+
|
|
175
|
+
| Name | Type | Description |
|
|
176
|
+
| :------ | :------ | :------ |
|
|
177
|
+
| `caption` | `string` | The menu's head: what the thing is (its name). |
|
|
178
|
+
| `icon?` | `React.JSX.Element` | A drawing in front of the caption, such as an [Icon](icons.md#icon). |
|
|
179
|
+
| `items` | [`MenuElement`](#menuelement)[] | The entries. |
|
|
180
|
+
| `menuInfo` | [`MenuInfo`](#menuinfo)<`any`> | What the menu is on: the entries' handlers are called with it. |
|
|
181
|
+
| `onHide()?` | () => `void` | Called when the menu closes, after a click on an entry or beside it. |
|
|
182
|
+
|
|
183
|
+
***
|
|
184
|
+
|
|
185
|
+
### MenuElement {#menuelement}
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
type MenuElement =
|
|
189
|
+
| Omit<MenuItemType, "onClick"> & {
|
|
190
|
+
onClick?: (menuInfo) => void;
|
|
191
|
+
onMouseEnter?: (menuInfo) => void;
|
|
192
|
+
onMouseLeave?: (menuInfo) => void;
|
|
193
|
+
}
|
|
194
|
+
| Omit<SubMenuType<MenuItemType>, "children" | "onClick"> & {
|
|
195
|
+
children: | MenuElement[]
|
|
196
|
+
| ((menuInfo) => MenuElement[]);
|
|
197
|
+
onClick?: (menuInfo) => void;
|
|
198
|
+
}
|
|
199
|
+
| Omit<MenuItemGroupType<MenuItemType>, "children"> & {
|
|
200
|
+
children: MenuElement[];
|
|
201
|
+
}
|
|
202
|
+
| MenuDividerType
|
|
203
|
+
| null;
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
An entry of a [ContextMenu](#contextmenu): antd's menu items (an item, a submenu, a group, a divider) with handlers that
|
|
207
|
+
take the menu's [MenuInfo](#menuinfo). `null` is left out, for entries that are there only sometimes.
|
|
208
|
+
|
|
209
|
+
***
|
|
210
|
+
|
|
211
|
+
### MenuInfo {#menuinfo}
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
type MenuInfo<T> = T extends void ? {
|
|
215
|
+
interactionInfo: InteractionInfo;
|
|
216
|
+
} : {
|
|
217
|
+
interactionInfo: InteractionInfo;
|
|
218
|
+
} & {
|
|
219
|
+
clickInfo: T;
|
|
220
|
+
};
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
What a [ContextMenu](#contextmenu) is opened on, which its entries' handlers are called with: the thing's interaction info,
|
|
224
|
+
and with a type argument also `clickInfo`, what the app knows of the click (such as where on the stage it was).
|
|
225
|
+
|
|
226
|
+
#### Type Parameters
|
|
227
|
+
|
|
228
|
+
| Type Parameter | Default type | Description |
|
|
229
|
+
| :------ | :------ | :------ |
|
|
230
|
+
| <a id="type-parameter-t"></a> `T` | `void` | The type of `clickInfo`; without it there is none. |
|
|
231
|
+
|
|
232
|
+
***
|
|
233
|
+
|
|
234
|
+
### MenuItem {#menuitem}
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
type MenuItem = {
|
|
238
|
+
callback: (e) => void;
|
|
239
|
+
caption: string | React.JSX.Element;
|
|
240
|
+
children?: undefined;
|
|
241
|
+
icon?: React.JSX.Element;
|
|
242
|
+
};
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
An entry of a [Menu](#menu): what it says, and what a click on it does.
|
|
246
|
+
|
|
247
|
+
#### Properties
|
|
248
|
+
|
|
249
|
+
| Property | Type | Description |
|
|
250
|
+
| :------ | :------ | :------ |
|
|
251
|
+
| <a id="property-callback"></a> `callback` | (`e`) => `void` | Called when the entry is clicked (or chosen with the keyboard). |
|
|
252
|
+
| <a id="property-caption"></a> `caption` | `string` \| `React.JSX.Element` | What the entry says. |
|
|
253
|
+
| <a id="property-children"></a> `children?` | `undefined` | An entry has no entries of its own; one with entries is a submenu. |
|
|
254
|
+
| <a id="property-icon"></a> `icon?` | `React.JSX.Element` | A drawing in front of it, such as an [Icon](icons.md#icon). |
|
|
255
|
+
|
|
256
|
+
***
|
|
257
|
+
|
|
258
|
+
### MenuItems {#menuitems}
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
type MenuItems = Record<string,
|
|
262
|
+
| MenuItem
|
|
263
|
+
| {
|
|
264
|
+
caption: string;
|
|
265
|
+
children: Record<string, MenuItem>;
|
|
266
|
+
icon?: Element;
|
|
267
|
+
}>;
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The entries of a [Menu](#menu), by key, in the order they are shown: each a [MenuItem](#menuitem), or a submenu with
|
|
271
|
+
entries of its own (`{ caption, icon?, children: { [key]: MenuItem } }`).
|
|
272
|
+
|
|
273
|
+
***
|
|
274
|
+
|
|
275
|
+
### RCadMenuProps {#rcadmenuprops}
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
type RCadMenuProps = Omit<{
|
|
279
|
+
items: MenuItems;
|
|
280
|
+
} & DropDownProps, "overlay">;
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Props of [Menu](#menu): its entries, and any of antd's `Dropdown` props (but `overlay`) to set how it opens.
|
|
284
|
+
|
|
285
|
+
## Advanced
|
|
286
|
+
|
|
287
|
+
Most apps do not need these directly: types they meet through the exports above, and what is there for special cases or for building on buerli itself.
|
|
288
|
+
|
|
289
|
+
### FieldContext {#fieldcontext}
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
const FieldContext: Context<{
|
|
293
|
+
hint?: string;
|
|
294
|
+
}>;
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
What a field tells the control inside it: here, what its picker ([elements](#elements).Selection) says while it is
|
|
298
|
+
empty and not listening.
|
|
299
|
+
|
|
300
|
+
The feature dialogs' fields provide it; a `caption` given to the picker itself goes first.
|
|
301
|
+
|
|
302
|
+
***
|
|
303
|
+
|
|
304
|
+
### RCadElements {#rcadelements}
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
type RCadElements = typeof elements;
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
The type of react-cad's [elements](#elements).
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Work Geometry
|
|
2
|
+
|
|
3
|
+
The dialogs of a part's work points, axes, planes and coordinate systems: the references that sketches, features
|
|
4
|
+
and assembly mates are placed on. They are registered and opened as the feature plugins are, and their views draw
|
|
5
|
+
the work geometry in the scene.
|
|
6
|
+
|
|
7
|
+
## Plugins
|
|
8
|
+
|
|
9
|
+
### WorkAxis {#workaxis}
|
|
10
|
+
|
|
11
|
+
The Work Axis feature's dialog: places a work axis by coordinates or on geometry: a curve, two points, two planes.
|
|
12
|
+
|
|
13
|
+
It is the plugin of the feature class `CC_WorkAxis`: an app maps the class to it in `init`'s `plugins`, and react-cad
|
|
14
|
+
opens it when the toolbar makes a new work axis and when one is double-clicked in the feature list. The dialog picks
|
|
15
|
+
the type (a point and a direction as coordinates, a curve, two points, two planes, or a point and a direction picked
|
|
16
|
+
in the model) and the geometry it is made from. Apply updates the feature (`part.updateWorkAxis`). Its view draws the
|
|
17
|
+
axis while the feature is shown or its dialog is open.
|
|
18
|
+
|
|
19
|
+
#### Example
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { init, ScgClassType, WASMClient } from '@classcad/client'
|
|
23
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
24
|
+
import { elements, WorkAxis } from '@classcad/react-cad'
|
|
25
|
+
|
|
26
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
27
|
+
elements,
|
|
28
|
+
plugins: { [ScgClassType.CCWorkAxis]: WorkAxis },
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// Code opens one by making it the active feature, with the id that `api.v1.part.workAxis` returns:
|
|
32
|
+
getDrawing(drawingId).api.plugin.setActiveFeature(axisId)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### WorkCSys {#workcsys}
|
|
38
|
+
|
|
39
|
+
The Work Coordinate System feature's dialog: places a coordinate system on an origin and two axes, offset and
|
|
40
|
+
rotated.
|
|
41
|
+
|
|
42
|
+
It is the plugin of the feature class `CC_WorkCSys`: an app maps the class to it in `init`'s `plugins`, and react-cad
|
|
43
|
+
opens it when the toolbar makes a new coordinate system and when one is double-clicked in the feature list. The
|
|
44
|
+
dialog picks the type: Set takes an origin (a point, a vertex, an arc or a circle) and a primary and a secondary
|
|
45
|
+
axis, the primary one invertible; Set and Custom take an offset and a rotation as Euler angles; Fixed is read-only.
|
|
46
|
+
Apply updates the feature (`part.updateWorkCSys`). Its view draws the coordinate system, and its preview while the
|
|
47
|
+
dialog is open.
|
|
48
|
+
|
|
49
|
+
#### Example
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { init, ScgClassType, WASMClient } from '@classcad/client'
|
|
53
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
54
|
+
import { elements, WorkCSys } from '@classcad/react-cad'
|
|
55
|
+
|
|
56
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
57
|
+
elements,
|
|
58
|
+
plugins: { [ScgClassType.CCWorkCSys]: WorkCSys },
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
// Code opens one by making it the active feature, with the id that `api.v1.part.workCSys` returns:
|
|
62
|
+
getDrawing(drawingId).api.plugin.setActiveFeature(csysId)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### WorkPlane {#workplane}
|
|
68
|
+
|
|
69
|
+
The Work Plane feature's dialog: places a work plane on a base plane, a plane, points or lines, with an offset.
|
|
70
|
+
|
|
71
|
+
It is the plugin of the feature class `CC_WorkPlane`: an app maps the class to it in `init`'s `plugins`, and
|
|
72
|
+
react-cad opens it when the toolbar makes a new work plane and when one is double-clicked in the feature list. The
|
|
73
|
+
dialog picks the type (one of the base planes, a plane, three points, a line and a point, a point and a normal, a
|
|
74
|
+
point and a plane, a line and a plane at an angle, or a position and a normal as coordinates) and the geometry, and
|
|
75
|
+
takes the offset or the angle. Apply updates the feature (`part.updateWorkPlane`). Its view draws the plane while the
|
|
76
|
+
feature is shown or its dialog is open.
|
|
77
|
+
|
|
78
|
+
#### Example
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { init, ScgClassType, WASMClient } from '@classcad/client'
|
|
82
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
83
|
+
import { elements, WorkPlane } from '@classcad/react-cad'
|
|
84
|
+
|
|
85
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
86
|
+
elements,
|
|
87
|
+
plugins: { [ScgClassType.CCWorkPlane]: WorkPlane },
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
// Code opens one by making it the active feature, with the id that `api.v1.part.workPlane` returns:
|
|
91
|
+
getDrawing(drawingId).api.plugin.setActiveFeature(planeId)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
***
|
|
95
|
+
|
|
96
|
+
### WorkPoint {#workpoint}
|
|
97
|
+
|
|
98
|
+
The Work Point feature's dialog: places a work point by coordinates or on geometry: a vertex, a midpoint, a center.
|
|
99
|
+
|
|
100
|
+
It is the plugin of the feature class `CC_WorkPoint`: an app maps the class to it in `init`'s `plugins`, and
|
|
101
|
+
react-cad opens it when the toolbar makes a new work point and when one is double-clicked in the feature list. The
|
|
102
|
+
dialog picks the type (coordinates, a point, the midpoint of a line or of two points, the center of an arc or circle,
|
|
103
|
+
the barycenter of a face, the intersection of two lines, or the incircle center of three lines) and the geometry it
|
|
104
|
+
is made from. Apply updates the feature (`part.updateWorkPoint`). Its view draws the point while the feature is shown
|
|
105
|
+
or its dialog is open.
|
|
106
|
+
|
|
107
|
+
#### Example
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import { init, ScgClassType, WASMClient } from '@classcad/client'
|
|
111
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
112
|
+
import { elements, WorkPoint } from '@classcad/react-cad'
|
|
113
|
+
|
|
114
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
115
|
+
elements,
|
|
116
|
+
plugins: { [ScgClassType.CCWorkPoint]: WorkPoint },
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// Code opens one by making it the active feature, with the id that `api.v1.part.workPoint` returns:
|
|
120
|
+
getDrawing(drawingId).api.plugin.setActiveFeature(pointId)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Advanced
|
|
124
|
+
|
|
125
|
+
Most apps do not need these directly: types they meet through the exports above, and what is there for special cases or for building on buerli itself.
|
|
126
|
+
|
|
127
|
+
### WorkCoordSystem {#workcoordsystem}
|
|
128
|
+
|
|
129
|
+
The dialog of `CC_WorkCoordSystem` features: places a coordinate system at an origin and two axes, or at coordinates.
|
|
130
|
+
|
|
131
|
+
It is the plugin of the feature class `CC_WorkCoordSystem`, which ClassCAD's v0 API updates
|
|
132
|
+
(`feature.updateWorkCoordSystem`); the coordinate systems that react-cad's toolbar makes are of the class
|
|
133
|
+
`CC_WorkCSys`, whose plugin is [WorkCSys](#workcsys). An app whose models have such features (no call of ClassCAD's API
|
|
134
|
+
makes one) maps the class to it in `init`'s `plugins`, and a double click in the feature list opens it. Set takes an
|
|
135
|
+
origin and a primary and a secondary axis; Custom takes the origin and the directions of the axes as coordinates;
|
|
136
|
+
both take an offset and a rotation as Euler angles.
|
|
137
|
+
|
|
138
|
+
#### Example
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
import { init, ScgClassType, WASMClient } from '@classcad/client'
|
|
142
|
+
import { getDrawing } from '@classcad/sdkjs'
|
|
143
|
+
import { elements, WorkCoordSystem } from '@classcad/react-cad'
|
|
144
|
+
|
|
145
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
146
|
+
elements,
|
|
147
|
+
plugins: { [ScgClassType.CCWorkCoordSystem]: WorkCoordSystem },
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
// Code opens one of the drawing's tree by making it the active feature:
|
|
151
|
+
const { structure, api } = getDrawing(drawingId)
|
|
152
|
+
const csys = Object.values(structure.tree).find(obj => obj.class === ScgClassType.CCWorkCoordSystem)
|
|
153
|
+
if (csys) api.plugin.setActiveFeature(csys.id)
|
|
154
|
+
```
|