@classcad/react-cad 0.0.0-stage → 3.0.0-beta.20261119100608
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 +57 -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 +109 -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,848 @@
|
|
|
1
|
+
# Graphics
|
|
2
|
+
|
|
3
|
+
What goes into the app's canvas besides the geometry: `StageLook`, the model as a drawing, and the pieces the
|
|
4
|
+
plugins draw with.
|
|
5
|
+
|
|
6
|
+
## Components
|
|
7
|
+
|
|
8
|
+
### StageLook {#stagelook}
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
const StageLook: React.FC<StageLookProps>;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The model on the stage: a solid body, drawn by its lines as a drawing shows it (BRANDING.md,
|
|
15
|
+
"The stage").
|
|
16
|
+
- **Body.** A body the model gives a colour of its own keeps it; the engine's stock grey takes
|
|
17
|
+
the theme's body tone: a neutral grey that stands clearly off the ground, in either theme.
|
|
18
|
+
- **Edges.** The engine's edges are hairlines (a GL line is one device pixel wide, half a pixel
|
|
19
|
+
on a dense screen). Each is drawn instead as a line of real width, which takes its colour and
|
|
20
|
+
its opacity from the hairline, so whatever recolours or fades the model's edges still does.
|
|
21
|
+
The hairline stays where it is, unseen, as what is pointed at and picked. Seams, where a
|
|
22
|
+
curved face meets itself, are drawn like every other edge: what can be picked is seen.
|
|
23
|
+
- **Silhouettes.** Where a curved face turns away from the eye there is no edge, and a drawing
|
|
24
|
+
has a line. It is found for the view as it stands, and found again when the view turns.
|
|
25
|
+
- **Thin bodies.** A body only a few lines thick on screen (a rod, a wire, a sheet from far off)
|
|
26
|
+
is drawn by its faces: it has no silhouette, and the edges of a body that narrow, or edges that
|
|
27
|
+
lie that close together, take on its colour. A dense model reads as its parts, not as ink.
|
|
28
|
+
|
|
29
|
+
Mount it inside the canvas, beside the geometry. (That the edges are ink is the theme's doing:
|
|
30
|
+
[Drawing](panels.md#drawing) tells the engine's geometry so.) Without it the model is the engine's own grey with hairline edges.
|
|
31
|
+
Its props: [StageLookProps](#stagelookprops).
|
|
32
|
+
|
|
33
|
+
#### Example
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { Canvas } from '@react-three/fiber'
|
|
37
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
38
|
+
import { BuerliGeometry } from '@classcad/react'
|
|
39
|
+
import { StageLook } from '@classcad/react-cad'
|
|
40
|
+
|
|
41
|
+
// the model drawn as a drawing: heavier lines, and no silhouettes on its curved faces
|
|
42
|
+
const Stage = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
43
|
+
<Canvas orthographic>
|
|
44
|
+
<StageLook weight={1.8} silhouettes={false} />
|
|
45
|
+
<BuerliGeometry drawingId={drawingId} />
|
|
46
|
+
</Canvas>
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
***
|
|
51
|
+
|
|
52
|
+
### GeometryOverridesManager {#geometryoverridesmanager}
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const GeometryOverridesManager: React.FC<GeometryOverridesManagerProps>;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Applies the colour overrides that [useOverrideGeometryColor](#useoverridegeometrycolor) registers to the model's meshes and edges in the
|
|
59
|
+
scene.
|
|
60
|
+
|
|
61
|
+
It swaps the material of each mesh and edge of the geometry for a recoloured copy, and puts the material back when
|
|
62
|
+
the override goes. It applies them anew when the geometry, the active feature or the rollback bar changes. Without
|
|
63
|
+
it, the overrides do nothing: mount it once inside the canvas. Its props: [GeometryOverridesManagerProps](#geometryoverridesmanagerprops).
|
|
64
|
+
|
|
65
|
+
#### Example
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Canvas } from '@react-three/fiber'
|
|
69
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
70
|
+
import { BuerliGeometry } from '@classcad/react'
|
|
71
|
+
import { GeometryOverridesManager, HoveredConstraintDisplay, PluginGeometryBounds, StageLook } from '@classcad/react-cad'
|
|
72
|
+
|
|
73
|
+
// the pieces an app's own canvas carries for react-cad's plugins and panels
|
|
74
|
+
const Stage = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
75
|
+
<Canvas orthographic>
|
|
76
|
+
<StageLook />
|
|
77
|
+
<GeometryOverridesManager drawingId={drawingId} />
|
|
78
|
+
<HoveredConstraintDisplay drawingId={drawingId} />
|
|
79
|
+
<BuerliGeometry drawingId={drawingId} />
|
|
80
|
+
<PluginGeometryBounds drawingId={drawingId} />
|
|
81
|
+
</Canvas>
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Types
|
|
86
|
+
|
|
87
|
+
### GeometryOverridesManagerProps {#geometryoverridesmanagerprops}
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
type GeometryOverridesManagerProps = {
|
|
91
|
+
drawingId: DrawingID;
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Props of [GeometryOverridesManager](#geometryoverridesmanager).
|
|
96
|
+
|
|
97
|
+
#### Properties
|
|
98
|
+
|
|
99
|
+
| Property | Type | Description |
|
|
100
|
+
| :------ | :------ | :------ |
|
|
101
|
+
| <a id="property-drawingid-2"></a> `drawingId` | `DrawingID` | The drawing whose geometry is recoloured. |
|
|
102
|
+
|
|
103
|
+
***
|
|
104
|
+
|
|
105
|
+
### StageLookProps {#stagelookprops}
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
type StageLookProps = {
|
|
109
|
+
silhouettes?: boolean;
|
|
110
|
+
weight?: number;
|
|
111
|
+
};
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Props of [StageLook](#stagelook).
|
|
115
|
+
|
|
116
|
+
#### Properties
|
|
117
|
+
|
|
118
|
+
| Property | Type | Description |
|
|
119
|
+
| :------ | :------ | :------ |
|
|
120
|
+
| <a id="property-silhouettes"></a> `silhouettes?` | `boolean` | false leaves curved faces without their silhouettes. Default `true`. |
|
|
121
|
+
| <a id="property-weight"></a> `weight?` | `number` | How wide a line is inked, in px. Default `1.4`. |
|
|
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 the SDK itself.
|
|
126
|
+
|
|
127
|
+
### Badge {#badge}
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
const Badge: React.FC<BadgeProps>;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
A badge on the stage: a constraint's sign where it holds. At rest a light disc with a faint shadow
|
|
134
|
+
ring. A badge that has something to say (it is under the pointer, in hand, redundant, in conflict)
|
|
135
|
+
is lit in that colour. Its glyph is the same in every state: black in the light theme, white in the dark.
|
|
136
|
+
|
|
137
|
+
Its three layers lie in one plane, at the badge's offset, and are drawn in their order: the disc
|
|
138
|
+
and the ring are a ground that leaves the depth alone, so the glyph is never measured against
|
|
139
|
+
them. (They were set apart by fractions of a polygon offset, which WebGPU takes in whole units
|
|
140
|
+
only: there the disc came out in front, and the badges were empty.) A badge `onTop`, in a HUD,
|
|
141
|
+
is not measured against anything: it lies in the sketch's plane with its lines and regions,
|
|
142
|
+
which in a slanted view and on WebGPU won it by a hair or lost it as the view was zoomed.
|
|
143
|
+
|
|
144
|
+
It lies in the XY plane of where it is put, and takes no pointer. Its props: [BadgeProps](#badgeprops).
|
|
145
|
+
|
|
146
|
+
#### Example
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import { useMemo } from 'react'
|
|
150
|
+
import * as THREE from 'three'
|
|
151
|
+
import { Badge, iconDataUrl, useStage } from '@classcad/react-cad'
|
|
152
|
+
|
|
153
|
+
// a badge of the app's own on the stage: a pin's sign, lit while it is under the pointer
|
|
154
|
+
function PinBadge({ position, hovered }: { position: [number, number, number]; hovered: boolean }) {
|
|
155
|
+
const stage = useStage()
|
|
156
|
+
const glyph = useMemo(() => new THREE.TextureLoader().load(iconDataUrl('pin', { ink: '#ffffff' }, 96, 18)), [])
|
|
157
|
+
return (
|
|
158
|
+
<group position={position}>
|
|
159
|
+
<Badge size={6} texture={glyph} tone={hovered ? stage.sketchHover : undefined} renderOrder={10} />
|
|
160
|
+
</group>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
***
|
|
166
|
+
|
|
167
|
+
### BadgeProps {#badgeprops}
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
type BadgeProps = {
|
|
171
|
+
glyph?: number;
|
|
172
|
+
onTop?: boolean;
|
|
173
|
+
polygonOffsetUnits?: number;
|
|
174
|
+
renderOrder?: number;
|
|
175
|
+
size: number;
|
|
176
|
+
texture?: THREE.Texture | null;
|
|
177
|
+
tone?: THREE.ColorRepresentation;
|
|
178
|
+
};
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Props of [Badge](#badge).
|
|
182
|
+
|
|
183
|
+
#### Properties
|
|
184
|
+
|
|
185
|
+
| Property | Type | Description |
|
|
186
|
+
| :------ | :------ | :------ |
|
|
187
|
+
| <a id="property-glyph"></a> `glyph?` | `number` | The glyph's width, as a share of the disc's. Default `0.9`. |
|
|
188
|
+
| <a id="property-ontop"></a> `onTop?` | `boolean` | Drawn over what it lies on, in its render order (a HUD's badge): no depth test. Default `false`. |
|
|
189
|
+
| <a id="property-polygonoffsetunits"></a> `polygonOffsetUnits?` | `number` | The polygon offset of its layers, in whole units. Default `0`. |
|
|
190
|
+
| <a id="property-renderorder"></a> `renderOrder?` | `number` | The render order of the glyph; the disc and the ring are drawn just before it. Default `0`. |
|
|
191
|
+
| <a id="property-size"></a> `size` | `number` | The disc's diameter, in the scene's units. |
|
|
192
|
+
| <a id="property-texture"></a> `texture?` | `THREE.Texture` \| `null` | The glyph: a texture of a drawing in white (see glyphTexture, or [iconDataUrl](icons.md#icondataurl)), which the badge colours. |
|
|
193
|
+
| <a id="property-tone"></a> `tone?` | `THREE.ColorRepresentation` | The colour the badge is lit in, when it has something to say. Without it, it is at rest. |
|
|
194
|
+
|
|
195
|
+
***
|
|
196
|
+
|
|
197
|
+
### CompositeCurveObj {#compositecurveobj}
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
const CompositeCurveObj: React.FC<CompositeCurveObjProps>;
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Draws a composite curve of the drawing's structure on the stage: its curves as lines of a width in px.
|
|
204
|
+
|
|
205
|
+
It draws what the engine tessellated of the curve (its lines, edges and arcs), over the model. Its props:
|
|
206
|
+
[CompositeCurveObjProps](#compositecurveobjprops). See [WorkPointObj](#workpointobj).
|
|
207
|
+
|
|
208
|
+
***
|
|
209
|
+
|
|
210
|
+
### CompositeCurveObjProps {#compositecurveobjprops}
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
type CompositeCurveObjProps = {
|
|
214
|
+
color?: THREE.ColorRepresentation;
|
|
215
|
+
drawingId: DrawingID;
|
|
216
|
+
handlers?: any;
|
|
217
|
+
lineWidth?: number;
|
|
218
|
+
objectId: ObjectID;
|
|
219
|
+
userData?: any;
|
|
220
|
+
};
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Props of [CompositeCurveObj](#compositecurveobj).
|
|
224
|
+
|
|
225
|
+
#### Properties
|
|
226
|
+
|
|
227
|
+
| Property | Type | Description |
|
|
228
|
+
| :------ | :------ | :------ |
|
|
229
|
+
| <a id="property-color"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: the stage's datum colour ([StageColors](theme.md#stagecolors-3).datum). |
|
|
230
|
+
| <a id="property-drawingid"></a> `drawingId` | `DrawingID` | The drawing the curve is in. |
|
|
231
|
+
| <a id="property-handlers"></a> `handlers?` | `any` | Pointer handlers for its lines (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
232
|
+
| <a id="property-linewidth"></a> `lineWidth?` | `number` | How wide its line is, in px. Default `3`. |
|
|
233
|
+
| <a id="property-objectid"></a> `objectId` | `ObjectID` | The composite curve (`CC_CompositeCurve`) in the drawing's structure tree. |
|
|
234
|
+
| <a id="property-userdata"></a> `userData?` | `any` | Given to its lines' `userData`, for whoever picks it from the scene. |
|
|
235
|
+
|
|
236
|
+
***
|
|
237
|
+
|
|
238
|
+
### CSysDisplay {#csysdisplay}
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
const CSysDisplay: React.FC<CSysDisplayProps>;
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Shows the mates of an assembly on the stage: the work coordinate systems of its instances, in a [HUD](#hud).
|
|
245
|
+
|
|
246
|
+
It walks the current instance and the instances in it. A mate that is selected in a field (an assembly
|
|
247
|
+
constraint's) is drawn flipped and turned as the field has it; the others as their coordinate system lies, as
|
|
248
|
+
`displayMode` says. An instance that does not take part shows only its selected mates. It goes inside the canvas.
|
|
249
|
+
Its props: [CSysDisplayProps](#csysdisplayprops).
|
|
250
|
+
|
|
251
|
+
#### Example
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
255
|
+
import { CSysDisplay, CSysDisplayMode, EditMode, useEditMode } from '@classcad/react-cad'
|
|
256
|
+
|
|
257
|
+
// in the canvas: the mates the user switched visible in the tree, while an assembly is worked on
|
|
258
|
+
function Mates({ drawingId }: { drawingId: DrawingID }) {
|
|
259
|
+
const mode = useEditMode(drawingId)
|
|
260
|
+
if (mode !== EditMode.Assembly) return null
|
|
261
|
+
return <CSysDisplay drawingId={drawingId} displayMode={CSysDisplayMode.DisplayVisible} />
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
***
|
|
266
|
+
|
|
267
|
+
### CSysDisplayMode {#csysdisplaymode}
|
|
268
|
+
|
|
269
|
+
Which mates [CSysDisplay](#csysdisplay) shows.
|
|
270
|
+
|
|
271
|
+
#### Enumeration Members
|
|
272
|
+
|
|
273
|
+
| Enumeration Member | Value | Description |
|
|
274
|
+
| :------ | :------ | :------ |
|
|
275
|
+
| <a id="enumeration-member-displayall"></a> `DisplayAll` | `0` | Every mate of the instances that take part. |
|
|
276
|
+
| <a id="enumeration-member-displayhovered"></a> `DisplayHovered` | `1` | The mates of the instance under the pointer (for a while after it leaves), and the selected ones. |
|
|
277
|
+
| <a id="enumeration-member-displayvisible"></a> `DisplayVisible` | `2` | The mates switched visible in the assembly's tree. |
|
|
278
|
+
|
|
279
|
+
***
|
|
280
|
+
|
|
281
|
+
### CSysDisplayProps {#csysdisplayprops}
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
type CSysDisplayProps = {
|
|
285
|
+
csys?: React.FC<{
|
|
286
|
+
drawingId: DrawingID;
|
|
287
|
+
matrix: THREE.Matrix4;
|
|
288
|
+
userData: {
|
|
289
|
+
csysId: ObjectID;
|
|
290
|
+
path: ObjectID[];
|
|
291
|
+
};
|
|
292
|
+
}>;
|
|
293
|
+
displayMode?: CSysDisplayMode;
|
|
294
|
+
drawingId: DrawingID;
|
|
295
|
+
includeSelected?: boolean;
|
|
296
|
+
instances?: ObjectID[];
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Props of [CSysDisplay](#csysdisplay).
|
|
301
|
+
|
|
302
|
+
#### Properties
|
|
303
|
+
|
|
304
|
+
| Property | Type | Description |
|
|
305
|
+
| :------ | :------ | :------ |
|
|
306
|
+
| <a id="property-csys"></a> `csys?` | `React.FC`<\{ `drawingId`: `DrawingID`; `matrix`: `THREE.Matrix4`; `userData`: \{ `csysId`: `ObjectID`; `path`: `ObjectID`[]; \}; \}> | A component that draws a mate that is not selected, instead of the stock axes. |
|
|
307
|
+
| <a id="property-displaymode"></a> `displayMode?` | [`CSysDisplayMode`](#csysdisplaymode) | Which mates are shown. Default [CSysDisplayMode.DisplayAll](#enumeration-member-displayall). |
|
|
308
|
+
| <a id="property-drawingid-1"></a> `drawingId` | `DrawingID` | The drawing whose current assembly's mates are shown. |
|
|
309
|
+
| <a id="property-includeselected"></a> `includeSelected?` | `boolean` | Lets an instance take part that already has a mate selected in another field, which by default does not (a constraint joins two instances); the current product's own mates then do not. Default `false`. |
|
|
310
|
+
| <a id="property-instances"></a> `instances?` | `ObjectID`[] | The instances whose mates take part, by their product. Default: the current product and every instance in it. |
|
|
311
|
+
|
|
312
|
+
***
|
|
313
|
+
|
|
314
|
+
### HoveredConstraintDisplay {#hoveredconstraintdisplay}
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
const HoveredConstraintDisplay: React.FC<HoveredConstraintDisplayProps>;
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Shows what an assembly constraint under the pointer holds: the two mates it joins, or, for a relation such as a
|
|
321
|
+
gear, the badges of the constraints it relates.
|
|
322
|
+
|
|
323
|
+
The pointer is on the constraint in the [Constraints](panels.md#constraints) list or on the stage (the drawing's hovered object).
|
|
324
|
+
Nothing is shown while a field picks. It goes inside the canvas, and draws in a [HUD](#hud); the example of
|
|
325
|
+
[GeometryOverridesManager](#geometryoverridesmanager) has it in its place. Its props: [HoveredConstraintDisplayProps](#hoveredconstraintdisplayprops).
|
|
326
|
+
|
|
327
|
+
***
|
|
328
|
+
|
|
329
|
+
### HoveredConstraintDisplayProps {#hoveredconstraintdisplayprops}
|
|
330
|
+
|
|
331
|
+
```ts
|
|
332
|
+
type HoveredConstraintDisplayProps = {
|
|
333
|
+
drawingId: DrawingID;
|
|
334
|
+
};
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Props of [HoveredConstraintDisplay](#hoveredconstraintdisplay).
|
|
338
|
+
|
|
339
|
+
#### Properties
|
|
340
|
+
|
|
341
|
+
| Property | Type | Description |
|
|
342
|
+
| :------ | :------ | :------ |
|
|
343
|
+
| <a id="property-drawingid-3"></a> `drawingId` | `DrawingID` | The drawing whose assembly constraints are pointed at. |
|
|
344
|
+
|
|
345
|
+
***
|
|
346
|
+
|
|
347
|
+
### HUD {#hud}
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
const HUD: React.FC<HUDProps>;
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Draws its children over the scene, after it and without its depth: what is in a HUD is never hidden by the model.
|
|
354
|
+
|
|
355
|
+
Every HUD of a canvas shares one scene, which is drawn once a frame with the stage's camera, and only while something
|
|
356
|
+
in it shows; its children are placed in the scene's coordinates as anywhere else. The work geometry, the mates and
|
|
357
|
+
the sketch's badges on the stage are drawn in one. It goes inside the canvas. Its props: [HUDProps](#hudprops).
|
|
358
|
+
|
|
359
|
+
#### Example
|
|
360
|
+
|
|
361
|
+
```tsx
|
|
362
|
+
import { Canvas } from '@react-three/fiber'
|
|
363
|
+
import type { DrawingID, ObjectID } from '@classcad/sdkjs'
|
|
364
|
+
import { useBuerliCadFacade } from '@classcad/react'
|
|
365
|
+
import { HUD, StageLook, WorkPointObj } from '@classcad/react-cad'
|
|
366
|
+
|
|
367
|
+
// a work point that stays in sight, even where the body is in front of it
|
|
368
|
+
function Stage({ pointId }: { pointId: ObjectID }) {
|
|
369
|
+
const { drawingId, Geometry } = useBuerliCadFacade('bracket')
|
|
370
|
+
return (
|
|
371
|
+
<Canvas orthographic>
|
|
372
|
+
<StageLook />
|
|
373
|
+
<Geometry />
|
|
374
|
+
<HUD>
|
|
375
|
+
<WorkPointObj drawingId={drawingId} objectId={pointId} color="#e7000b" />
|
|
376
|
+
</HUD>
|
|
377
|
+
</Canvas>
|
|
378
|
+
)
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
***
|
|
383
|
+
|
|
384
|
+
### HUDProps {#hudprops}
|
|
385
|
+
|
|
386
|
+
```ts
|
|
387
|
+
type HUDProps = {
|
|
388
|
+
children?: React.ReactNode;
|
|
389
|
+
};
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Props of [HUD](#hud).
|
|
393
|
+
|
|
394
|
+
#### Properties
|
|
395
|
+
|
|
396
|
+
| Property | Type | Description |
|
|
397
|
+
| :------ | :------ | :------ |
|
|
398
|
+
| <a id="property-children"></a> `children?` | `React.ReactNode` | What is drawn over the scene. |
|
|
399
|
+
|
|
400
|
+
***
|
|
401
|
+
|
|
402
|
+
### Outline {#outline}
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
const Outline: ForwardRefExoticComponent<{
|
|
406
|
+
edgeColor1?: [ColorRepresentation, ColorRepresentation];
|
|
407
|
+
edgeColor2?: [ColorRepresentation, ColorRepresentation];
|
|
408
|
+
edgeColor3?: [ColorRepresentation, ColorRepresentation];
|
|
409
|
+
width?: number;
|
|
410
|
+
} & Partial<{
|
|
411
|
+
selectionLayer: number;
|
|
412
|
+
selections1: Object3D<Object3DEventMap>[][];
|
|
413
|
+
selections2: Object3D<Object3DEventMap>[][];
|
|
414
|
+
selections3: Object3D<Object3DEventMap>[][];
|
|
415
|
+
}> & RefAttributes<OutlineEffect>>;
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
An outline effect for postprocessing's `EffectComposer`: draws a line around each object of up to three groups,
|
|
419
|
+
each group in its own colour.
|
|
420
|
+
|
|
421
|
+
It is an effect, not an object: it goes into an `EffectComposer` (`@react-three/postprocessing`), on WebGL. The
|
|
422
|
+
groups are what is hovered, selected and picked, say. A colour comes as a pair: the outline's colour, and the one
|
|
423
|
+
that stands in for it on a body of nearly that colour. A ref reaches the effect. Its props: [OutlineProps](#outlineprops).
|
|
424
|
+
|
|
425
|
+
#### Example
|
|
426
|
+
|
|
427
|
+
```tsx
|
|
428
|
+
import { EffectComposer } from '@react-three/postprocessing'
|
|
429
|
+
import type * as THREE from 'three'
|
|
430
|
+
import { Outline, useStage } from '@classcad/react-cad'
|
|
431
|
+
|
|
432
|
+
// in a WebGL canvas: what is hovered outlined in the highlight, held back; what is selected, in the highlight
|
|
433
|
+
function Outlines({ hovered, selected }: { hovered: THREE.Object3D[]; selected: THREE.Object3D[] }) {
|
|
434
|
+
const stage = useStage()
|
|
435
|
+
return (
|
|
436
|
+
<EffectComposer autoClear={false} multisampling={8}>
|
|
437
|
+
<Outline selections1={[hovered]} selections2={[selected]} width={4}
|
|
438
|
+
edgeColor1={[stage.hover, stage.alt]} edgeColor2={[stage.select, stage.alt]} />
|
|
439
|
+
</EffectComposer>
|
|
440
|
+
)
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
***
|
|
445
|
+
|
|
446
|
+
### OutlineProps {#outlineprops}
|
|
447
|
+
|
|
448
|
+
```ts
|
|
449
|
+
type OutlineProps = OutlineProps1;
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
Props of [Outline](#outline): the three groups of objects that are outlined, and the outlines' width and colours.
|
|
453
|
+
|
|
454
|
+
***
|
|
455
|
+
|
|
456
|
+
### PluginGeometryBounds {#plugingeometrybounds}
|
|
457
|
+
|
|
458
|
+
```ts
|
|
459
|
+
const PluginGeometryBounds: React.FC<PluginGeometryBoundsProps>;
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
An unseen box around what the plugins of the current part show: its visible work geometry and sketches.
|
|
463
|
+
|
|
464
|
+
It is a mesh that is not drawn, with the box as its geometry's bounds, so that what fits the view to the scene
|
|
465
|
+
(drei's `<Bounds>`) takes the work points, axes, planes, coordinate systems and sketches in, which are not part of
|
|
466
|
+
the model's geometry. It follows them as they change. It goes inside the canvas, next to the geometry that is
|
|
467
|
+
fitted. Its props: [PluginGeometryBoundsProps](#plugingeometryboundsprops).
|
|
468
|
+
|
|
469
|
+
#### Example
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
import { Bounds } from '@react-three/drei'
|
|
473
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
474
|
+
import { BuerliGeometry } from '@classcad/react'
|
|
475
|
+
import { PluginGeometryBounds } from '@classcad/react-cad'
|
|
476
|
+
|
|
477
|
+
// zoom to fit takes the work planes and sketches in, not only the bodies
|
|
478
|
+
const Fitted = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
479
|
+
<Bounds fit observe margin={1.2}>
|
|
480
|
+
<BuerliGeometry drawingId={drawingId} />
|
|
481
|
+
<PluginGeometryBounds drawingId={drawingId} />
|
|
482
|
+
</Bounds>
|
|
483
|
+
)
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
***
|
|
487
|
+
|
|
488
|
+
### PluginGeometryBoundsProps {#plugingeometryboundsprops}
|
|
489
|
+
|
|
490
|
+
```ts
|
|
491
|
+
type PluginGeometryBoundsProps = {
|
|
492
|
+
drawingId: DrawingID;
|
|
493
|
+
};
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
Props of [PluginGeometryBounds](#plugingeometrybounds).
|
|
497
|
+
|
|
498
|
+
#### Properties
|
|
499
|
+
|
|
500
|
+
| Property | Type | Description |
|
|
501
|
+
| :------ | :------ | :------ |
|
|
502
|
+
| <a id="property-drawingid-4"></a> `drawingId` | `DrawingID` | The drawing whose current part's features are measured. |
|
|
503
|
+
|
|
504
|
+
***
|
|
505
|
+
|
|
506
|
+
### SelectedMateObj {#selectedmateobj}
|
|
507
|
+
|
|
508
|
+
```ts
|
|
509
|
+
const SelectedMateObj: React.FC<SelectedMateObjProps>;
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Draws a mate of an assembly as it is selected: the coordinate system it is on, flipped and turned as the mate
|
|
513
|
+
says, where its path places it in the current instance.
|
|
514
|
+
|
|
515
|
+
Its props: [SelectedMateObjProps](#selectedmateobjprops). [CSysDisplay](#csysdisplay) draws all the mates of an assembly.
|
|
516
|
+
|
|
517
|
+
#### Example
|
|
518
|
+
|
|
519
|
+
```tsx
|
|
520
|
+
import { FlipType, ReorientedType } from '@classcad/client'
|
|
521
|
+
import type { DrawingID, ObjectID } from '@classcad/sdkjs'
|
|
522
|
+
import { HUD, SelectedMateObj, useStage } from '@classcad/react-cad'
|
|
523
|
+
|
|
524
|
+
// in the canvas: a mate the app has in hand, lying along -Z of its coordinate system, over the model
|
|
525
|
+
function MateInHand({ drawingId, csysId, path }: { drawingId: DrawingID; csysId: ObjectID; path: ObjectID[] }) {
|
|
526
|
+
const stage = useStage()
|
|
527
|
+
return (
|
|
528
|
+
<HUD>
|
|
529
|
+
<SelectedMateObj drawingId={drawingId} csysId={csysId} path={path} flip={FlipType.FLIP_Z_INV}
|
|
530
|
+
reorient={ReorientedType.REORIENTED_0} color={stage.pick} />
|
|
531
|
+
</HUD>
|
|
532
|
+
)
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
***
|
|
537
|
+
|
|
538
|
+
### SelectedMateObjProps {#selectedmateobjprops}
|
|
539
|
+
|
|
540
|
+
```ts
|
|
541
|
+
type SelectedMateObjProps = {
|
|
542
|
+
color?: THREE.ColorRepresentation;
|
|
543
|
+
csysId: ObjectID;
|
|
544
|
+
drawingId: DrawingID;
|
|
545
|
+
flip: FlipType;
|
|
546
|
+
opacity?: number;
|
|
547
|
+
path: ObjectID[];
|
|
548
|
+
reorient: ReorientedType;
|
|
549
|
+
};
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
Props of [SelectedMateObj](#selectedmateobj).
|
|
553
|
+
|
|
554
|
+
#### Properties
|
|
555
|
+
|
|
556
|
+
| Property | Type | Description |
|
|
557
|
+
| :------ | :------ | :------ |
|
|
558
|
+
| <a id="property-color-1"></a> `color?` | `THREE.ColorRepresentation` | Its colour. |
|
|
559
|
+
| <a id="property-csysid"></a> `csysId` | `ObjectID` | The work coordinate system the mate is on. |
|
|
560
|
+
| <a id="property-drawingid-5"></a> `drawingId` | `DrawingID` | The drawing the mate is in. |
|
|
561
|
+
| <a id="property-flip"></a> `flip` | `FlipType` | Which of the coordinate system's axes is the mate's main one, and which way. |
|
|
562
|
+
| <a id="property-opacity"></a> `opacity?` | `number` | Its opacity, from 0 to 1. |
|
|
563
|
+
| <a id="property-path"></a> `path` | `ObjectID`[] | The mate's path: the instances that lead to the coordinate system, as an assembly constraint's mate gives it. |
|
|
564
|
+
| <a id="property-reorient"></a> `reorient` | `ReorientedType` | How far the mate is turned about its main axis. |
|
|
565
|
+
|
|
566
|
+
***
|
|
567
|
+
|
|
568
|
+
### useOverrideGeometryColor() {#useoverridegeometrycolor}
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
function useOverrideGeometryColor(
|
|
572
|
+
name,
|
|
573
|
+
priority,
|
|
574
|
+
values,
|
|
575
|
+
solidIds?
|
|
576
|
+
): void;
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
Recolours bodies of the model while the component that calls it is mounted: a geometry override.
|
|
580
|
+
|
|
581
|
+
The override is registered under `name`, and removed again when the component unmounts or its arguments change;
|
|
582
|
+
[GeometryOverridesManager](#geometryoverridesmanager) applies it in the canvas. Where overrides meet on a body, the one with the lower
|
|
583
|
+
`priority` wins. An override without `solidIds` is for every body that no override of a lower priority has taken,
|
|
584
|
+
and overrides of a higher priority are then not applied at all. Keep `values` and `solidIds` the same objects from
|
|
585
|
+
render to render (`useMemo`): a new one registers the override anew.
|
|
586
|
+
|
|
587
|
+
#### Parameters
|
|
588
|
+
|
|
589
|
+
| Parameter | Type | Description |
|
|
590
|
+
| :------ | :------ | :------ |
|
|
591
|
+
| `name` | `string` | The override's name: one of the same name replaces it. |
|
|
592
|
+
| `priority` | `number` | Its priority: lower wins. |
|
|
593
|
+
| `values` | \{ `lineColor?`: `Color`; `lineOpacity?`: `number`; `meshColor?`: `Color`; `meshOpacity?`: `number`; \} | The colours it gives. |
|
|
594
|
+
| `values.lineColor?` | `Color` | The edges' colour. |
|
|
595
|
+
| `values.lineOpacity?` | `number` | The edges' opacity, from 0 to 1 (0 leaves it as it is). |
|
|
596
|
+
| `values.meshColor?` | `Color` | The faces' colour. |
|
|
597
|
+
| `values.meshOpacity?` | `number` | The faces' opacity, from 0 to 1 (0 leaves it as it is). |
|
|
598
|
+
| `solidIds?` | `number`[] | The bodies it is for, as [useVisibleSolids](hooks.md#usevisiblesolids) gives them; without them, all the others. |
|
|
599
|
+
|
|
600
|
+
#### Returns
|
|
601
|
+
|
|
602
|
+
`void`
|
|
603
|
+
|
|
604
|
+
#### Example
|
|
605
|
+
|
|
606
|
+
```tsx
|
|
607
|
+
import { useMemo } from 'react'
|
|
608
|
+
import type { ObjectID } from '@classcad/sdkjs'
|
|
609
|
+
import { useOverrideGeometryColor } from '@classcad/react-cad'
|
|
610
|
+
|
|
611
|
+
// while it is mounted, the bodies to keep stay as they are and all the others are see-through
|
|
612
|
+
function GhostTheRest({ keep }: { keep: ObjectID[] }) {
|
|
613
|
+
const asTheyAre = useMemo(() => ({}), [])
|
|
614
|
+
const ghost = useMemo(() => ({ meshOpacity: 0.2, lineOpacity: 0.2 }), [])
|
|
615
|
+
useOverrideGeometryColor('keep', 0, asTheyAre, keep)
|
|
616
|
+
useOverrideGeometryColor('ghost', 1, ghost)
|
|
617
|
+
return null
|
|
618
|
+
}
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
***
|
|
622
|
+
|
|
623
|
+
### WorkAxisObj {#workaxisobj}
|
|
624
|
+
|
|
625
|
+
```ts
|
|
626
|
+
const WorkAxisObj: React.FC<WorkAxisObjProps>;
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
Draws a work axis of the drawing's structure on the stage: an arrow from its position along its direction, the
|
|
630
|
+
same size on the screen at any zoom.
|
|
631
|
+
|
|
632
|
+
Its props: [WorkAxisObjProps](#workaxisobjprops). See [WorkPointObj](#workpointobj).
|
|
633
|
+
|
|
634
|
+
***
|
|
635
|
+
|
|
636
|
+
### WorkAxisObjProps {#workaxisobjprops}
|
|
637
|
+
|
|
638
|
+
```ts
|
|
639
|
+
type WorkAxisObjProps = {
|
|
640
|
+
color?: THREE.ColorRepresentation;
|
|
641
|
+
drawingId: DrawingID;
|
|
642
|
+
handlers?: any;
|
|
643
|
+
objectId: ObjectID;
|
|
644
|
+
opacity?: number;
|
|
645
|
+
userData?: any;
|
|
646
|
+
};
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Props of [WorkAxisObj](#workaxisobj).
|
|
650
|
+
|
|
651
|
+
#### Properties
|
|
652
|
+
|
|
653
|
+
| Property | Type | Description |
|
|
654
|
+
| :------ | :------ | :------ |
|
|
655
|
+
| <a id="property-color-2"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: the stage's datum colour ([StageColors](theme.md#stagecolors-3).datum). |
|
|
656
|
+
| <a id="property-drawingid-6"></a> `drawingId` | `DrawingID` | The drawing the object is in. |
|
|
657
|
+
| <a id="property-handlers-1"></a> `handlers?` | `any` | Pointer handlers for its meshes (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
658
|
+
| <a id="property-objectid-1"></a> `objectId` | `ObjectID` | The work axis (`CC_WorkAxis`) in the drawing's structure tree. |
|
|
659
|
+
| <a id="property-opacity-1"></a> `opacity?` | `number` | Its opacity, from 0 to 1. Default `1`. |
|
|
660
|
+
| <a id="property-userdata-1"></a> `userData?` | `any` | Given to its meshes' `userData`, for whoever picks it from the scene. |
|
|
661
|
+
|
|
662
|
+
***
|
|
663
|
+
|
|
664
|
+
### WorkCoordSystemObj {#workcoordsystemobj}
|
|
665
|
+
|
|
666
|
+
```ts
|
|
667
|
+
const WorkCoordSystemObj: React.FC<WorkCoordSystemObjProps>;
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
Draws a work coordinate system (`CC_WorkCoordSystem`) of the drawing's structure on the stage: its three axes.
|
|
671
|
+
|
|
672
|
+
Its props: [WorkCoordSystemObjProps](#workcoordsystemobjprops). See [WorkPointObj](#workpointobj).
|
|
673
|
+
|
|
674
|
+
***
|
|
675
|
+
|
|
676
|
+
### WorkCoordSystemObjProps {#workcoordsystemobjprops}
|
|
677
|
+
|
|
678
|
+
```ts
|
|
679
|
+
type WorkCoordSystemObjProps = {
|
|
680
|
+
color?: THREE.ColorRepresentation;
|
|
681
|
+
drawingId: DrawingID;
|
|
682
|
+
handlers?: any;
|
|
683
|
+
objectId: ObjectID;
|
|
684
|
+
opacity?: number;
|
|
685
|
+
userData?: any;
|
|
686
|
+
};
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Props of [WorkCoordSystemObj](#workcoordsystemobj).
|
|
690
|
+
|
|
691
|
+
#### Properties
|
|
692
|
+
|
|
693
|
+
| Property | Type | Description |
|
|
694
|
+
| :------ | :------ | :------ |
|
|
695
|
+
| <a id="property-color-3"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: its axes' own colours. |
|
|
696
|
+
| <a id="property-drawingid-7"></a> `drawingId` | `DrawingID` | The drawing the object is in. |
|
|
697
|
+
| <a id="property-handlers-2"></a> `handlers?` | `any` | Pointer handlers for its meshes (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
698
|
+
| <a id="property-objectid-2"></a> `objectId` | `ObjectID` | The work coordinate system (`CC_WorkCoordSystem`) in the drawing's structure tree. |
|
|
699
|
+
| <a id="property-opacity-2"></a> `opacity?` | `number` | Its opacity, from 0 to 1. Default `1`. |
|
|
700
|
+
| <a id="property-userdata-2"></a> `userData?` | `any` | Given to its meshes' `userData`, for whoever picks it from the scene. |
|
|
701
|
+
|
|
702
|
+
***
|
|
703
|
+
|
|
704
|
+
### WorkCSysObj {#workcsysobj}
|
|
705
|
+
|
|
706
|
+
```ts
|
|
707
|
+
const WorkCSysObj: React.FC<WorkCSysObjProps>;
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
Draws a work coordinate system (`CC_WorkCSys`) of the drawing's structure on the stage: its three axes, where its
|
|
711
|
+
coordinate system puts them.
|
|
712
|
+
|
|
713
|
+
Its props: [WorkCSysObjProps](#workcsysobjprops). See [WorkPointObj](#workpointobj).
|
|
714
|
+
|
|
715
|
+
***
|
|
716
|
+
|
|
717
|
+
### WorkCSysObjProps {#workcsysobjprops}
|
|
718
|
+
|
|
719
|
+
```ts
|
|
720
|
+
type WorkCSysObjProps = {
|
|
721
|
+
color?: THREE.ColorRepresentation;
|
|
722
|
+
drawingId: DrawingID;
|
|
723
|
+
handlers?: any;
|
|
724
|
+
objectId: ObjectID;
|
|
725
|
+
opacity?: number;
|
|
726
|
+
userData?: any;
|
|
727
|
+
};
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
Props of [WorkCSysObj](#workcsysobj).
|
|
731
|
+
|
|
732
|
+
#### Properties
|
|
733
|
+
|
|
734
|
+
| Property | Type | Description |
|
|
735
|
+
| :------ | :------ | :------ |
|
|
736
|
+
| <a id="property-color-4"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: its axes' own colours. |
|
|
737
|
+
| <a id="property-drawingid-8"></a> `drawingId` | `DrawingID` | The drawing the object is in. |
|
|
738
|
+
| <a id="property-handlers-3"></a> `handlers?` | `any` | Pointer handlers for its meshes (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
739
|
+
| <a id="property-objectid-3"></a> `objectId` | `ObjectID` | The work coordinate system (`CC_WorkCSys`) in the drawing's structure tree. |
|
|
740
|
+
| <a id="property-opacity-3"></a> `opacity?` | `number` | Its opacity, from 0 to 1. Default `1`. |
|
|
741
|
+
| <a id="property-userdata-3"></a> `userData?` | `any` | Given to its meshes' `userData`, for whoever picks it from the scene. |
|
|
742
|
+
|
|
743
|
+
***
|
|
744
|
+
|
|
745
|
+
### WorkPlaneObj {#workplaneobj}
|
|
746
|
+
|
|
747
|
+
```ts
|
|
748
|
+
const WorkPlaneObj: React.FC<WorkPlaneObjProps>;
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
Draws a work plane of the drawing's structure on the stage: a square of its size at its position, its outline over
|
|
752
|
+
a thin fill, seen from either side.
|
|
753
|
+
|
|
754
|
+
Its props: [WorkPlaneObjProps](#workplaneobjprops). See [WorkPointObj](#workpointobj).
|
|
755
|
+
|
|
756
|
+
***
|
|
757
|
+
|
|
758
|
+
### WorkPlaneObjProps {#workplaneobjprops}
|
|
759
|
+
|
|
760
|
+
```ts
|
|
761
|
+
type WorkPlaneObjProps = {
|
|
762
|
+
color?: THREE.ColorRepresentation;
|
|
763
|
+
drawingId: DrawingID;
|
|
764
|
+
handlers?: any;
|
|
765
|
+
objectId: ObjectID;
|
|
766
|
+
opacity?: number;
|
|
767
|
+
userData?: any;
|
|
768
|
+
};
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
Props of [WorkPlaneObj](#workplaneobj).
|
|
772
|
+
|
|
773
|
+
#### Properties
|
|
774
|
+
|
|
775
|
+
| Property | Type | Description |
|
|
776
|
+
| :------ | :------ | :------ |
|
|
777
|
+
| <a id="property-color-5"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: the stage's plane colour ([StageColors](theme.md#stagecolors-3).plane). |
|
|
778
|
+
| <a id="property-drawingid-9"></a> `drawingId` | `DrawingID` | The drawing the object is in. |
|
|
779
|
+
| <a id="property-handlers-4"></a> `handlers?` | `any` | Pointer handlers for its meshes (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
780
|
+
| <a id="property-objectid-4"></a> `objectId` | `ObjectID` | The work plane (`CC_WorkPlane`) in the drawing's structure tree. |
|
|
781
|
+
| <a id="property-opacity-4"></a> `opacity?` | `number` | Its opacity, from 0 to 1. Default `1`. |
|
|
782
|
+
| <a id="property-userdata-4"></a> `userData?` | `any` | Given to its meshes' `userData`, for whoever picks it from the scene. |
|
|
783
|
+
|
|
784
|
+
***
|
|
785
|
+
|
|
786
|
+
### WorkPointObj {#workpointobj}
|
|
787
|
+
|
|
788
|
+
```ts
|
|
789
|
+
const WorkPointObj: React.FC<WorkPointObjProps>;
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
Draws a work point of the drawing's structure on the stage: a dot at its position, the same size on the screen at
|
|
793
|
+
any zoom.
|
|
794
|
+
|
|
795
|
+
Buerligons draws one over the model where the pointer is on a work point, or where one is selected, in a
|
|
796
|
+
[HUD](#hud). Its props: [WorkPointObjProps](#workpointobjprops).
|
|
797
|
+
|
|
798
|
+
#### Example
|
|
799
|
+
|
|
800
|
+
```tsx
|
|
801
|
+
import { ScgClassType } from '@classcad/client'
|
|
802
|
+
import { useDrawing } from '@classcad/react'
|
|
803
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
804
|
+
import { HUD, useStage, WorkAxisObj, WorkPlaneObj, WorkPointObj } from '@classcad/react-cad'
|
|
805
|
+
|
|
806
|
+
// in the canvas: the work geometry under the pointer, drawn over the model in the highlight
|
|
807
|
+
function HoveredWorkGeometry({ drawingId }: { drawingId: DrawingID }) {
|
|
808
|
+
const stage = useStage()
|
|
809
|
+
const id = useDrawing(drawingId, (d) => d.interaction.hovered?.objectId)
|
|
810
|
+
const clazz = useDrawing(drawingId, (d) => (id ? d.structure.tree[id]?.class : undefined))
|
|
811
|
+
if (!id) return null
|
|
812
|
+
return (
|
|
813
|
+
<HUD>
|
|
814
|
+
{clazz === ScgClassType.CCWorkPoint && <WorkPointObj drawingId={drawingId} objectId={id} color={stage.hover} />}
|
|
815
|
+
{clazz === ScgClassType.CCWorkAxis && <WorkAxisObj drawingId={drawingId} objectId={id} color={stage.hover} />}
|
|
816
|
+
{clazz === ScgClassType.CCWorkPlane && <WorkPlaneObj drawingId={drawingId} objectId={id} color={stage.hover} opacity={0.22} />}
|
|
817
|
+
</HUD>
|
|
818
|
+
)
|
|
819
|
+
}
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
***
|
|
823
|
+
|
|
824
|
+
### WorkPointObjProps {#workpointobjprops}
|
|
825
|
+
|
|
826
|
+
```ts
|
|
827
|
+
type WorkPointObjProps = {
|
|
828
|
+
color?: THREE.ColorRepresentation;
|
|
829
|
+
drawingId: DrawingID;
|
|
830
|
+
handlers?: any;
|
|
831
|
+
objectId: ObjectID;
|
|
832
|
+
opacity?: number;
|
|
833
|
+
userData?: any;
|
|
834
|
+
};
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
Props of [WorkPointObj](#workpointobj).
|
|
838
|
+
|
|
839
|
+
#### Properties
|
|
840
|
+
|
|
841
|
+
| Property | Type | Description |
|
|
842
|
+
| :------ | :------ | :------ |
|
|
843
|
+
| <a id="property-color-6"></a> `color?` | `THREE.ColorRepresentation` | Its colour. Default: the stage's datum colour ([StageColors](theme.md#stagecolors-3).datum). |
|
|
844
|
+
| <a id="property-drawingid-10"></a> `drawingId` | `DrawingID` | The drawing the object is in. |
|
|
845
|
+
| <a id="property-handlers-5"></a> `handlers?` | `any` | Pointer handlers for its meshes (react-three-fiber's `onClick`, `onPointerOver`, …). |
|
|
846
|
+
| <a id="property-objectid-5"></a> `objectId` | `ObjectID` | The work point (`CC_WorkPoint`) in the drawing's structure tree. |
|
|
847
|
+
| <a id="property-opacity-5"></a> `opacity?` | `number` | Its opacity, from 0 to 1. Default `1`. |
|
|
848
|
+
| <a id="property-userdata-5"></a> `userData?` | `any` | Given to its meshes' `userData`, for whoever picks it from the scene. |
|