@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.
Files changed (471) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +98 -2
  3. package/build/components/UI/CAD/Constraints.d.ts +30 -0
  4. package/build/components/UI/CAD/Drawing.d.ts +83 -0
  5. package/build/components/UI/CAD/ListPlaceholder.d.ts +3 -0
  6. package/build/components/UI/CAD/Messages/Message.d.ts +8 -0
  7. package/build/components/UI/CAD/Messages/Messages.d.ts +43 -0
  8. package/build/components/UI/CAD/Messages/index.d.ts +1 -0
  9. package/build/components/UI/CAD/Messages/msgStore.d.ts +18 -0
  10. package/build/components/UI/CAD/ModelTree/AssemblyNode.d.ts +5 -0
  11. package/build/components/UI/CAD/ModelTree/FeatureList/Feature.d.ts +8 -0
  12. package/build/components/UI/CAD/ModelTree/FeatureList/FeatureList.d.ts +6 -0
  13. package/build/components/UI/CAD/ModelTree/FeatureList/index.d.ts +1 -0
  14. package/build/components/UI/CAD/ModelTree/FeatureList/utils.d.ts +26 -0
  15. package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +56 -0
  16. package/build/components/UI/CAD/ModelTree/ModelTreeHeader.d.ts +15 -0
  17. package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
  18. package/build/components/UI/CAD/ModelTree/primitives.d.ts +6 -0
  19. package/build/components/UI/CAD/ModelTree/useContextMenuItems.d.ts +4 -0
  20. package/build/components/UI/CAD/PluginBounds.d.ts +8 -0
  21. package/build/components/UI/CAD/PluginTooltip.d.ts +5 -0
  22. package/build/components/UI/CAD/PluginsWindows.d.ts +99 -0
  23. package/build/components/UI/CAD/ReadOnlyContext.d.ts +10 -0
  24. package/build/components/UI/CAD/SideBar.d.ts +40 -0
  25. package/build/components/UI/CAD/Solids/Solids.d.ts +23 -0
  26. package/build/components/UI/CAD/Solids/index.d.ts +1 -0
  27. package/build/components/UI/CAD/Solids/useContextMenuItems.d.ts +4 -0
  28. package/build/components/UI/CAD/Solids/useVisibleSolids.d.ts +30 -0
  29. package/build/components/UI/CAD/StageHud.d.ts +9 -0
  30. package/build/components/UI/CAD/StatusBar.d.ts +11 -0
  31. package/build/components/UI/CAD/ThemeToggle.d.ts +25 -0
  32. package/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +3 -0
  33. package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +3 -0
  34. package/build/components/UI/CAD/ToolBar/ToolBar.d.ts +24 -0
  35. package/build/components/UI/CAD/ToolBar/index.d.ts +1 -0
  36. package/build/components/UI/CAD/ToolBar/useCommands.d.ts +12 -0
  37. package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +30 -0
  38. package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +65 -0
  39. package/build/components/UI/CAD/ViewPlugButtons.d.ts +43 -0
  40. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModal.d.ts +18 -0
  41. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalContext.d.ts +9 -0
  42. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalInner.d.ts +27 -0
  43. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalProvider.d.ts +4 -0
  44. package/build/components/UI/CAD/ant-design-draggable-modal/OverlayScrollbar.d.ts +6 -0
  45. package/build/components/UI/CAD/ant-design-draggable-modal/ResizeHandle.d.ts +2 -0
  46. package/build/components/UI/CAD/ant-design-draggable-modal/clamp.d.ts +1 -0
  47. package/build/components/UI/CAD/ant-design-draggable-modal/draggableModalReducer.d.ts +123 -0
  48. package/build/components/UI/CAD/ant-design-draggable-modal/getWindowSize.d.ts +4 -0
  49. package/build/components/UI/CAD/ant-design-draggable-modal/index.d.ts +3 -0
  50. package/build/components/UI/CAD/ant-design-draggable-modal/useDrag.d.ts +5 -0
  51. package/build/components/UI/CAD/ant-design-draggable-modal/usePrevious.d.ts +1 -0
  52. package/build/components/UI/CAD/ant-design-draggable-modal/useResize.d.ts +7 -0
  53. package/build/components/UI/CAD/common/BlankDiv.d.ts +3 -0
  54. package/build/components/UI/CAD/common/Collapse.d.ts +13 -0
  55. package/build/components/UI/CAD/common/ContextMenu.d.ts +115 -0
  56. package/build/components/UI/CAD/common/Divider.d.ts +4 -0
  57. package/build/components/UI/CAD/common/EntityName.d.ts +14 -0
  58. package/build/components/UI/CAD/common/Img.d.ts +6 -0
  59. package/build/components/UI/CAD/common/LoadingScreen/LoadingScreen.d.ts +8 -0
  60. package/build/components/UI/CAD/common/LoadingScreen/Spinner.d.ts +3 -0
  61. package/build/components/UI/CAD/common/LoadingScreen/index.d.ts +1 -0
  62. package/build/components/UI/CAD/common/Menu.d.ts +81 -0
  63. package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
  64. package/build/components/UI/CAD/common/NameEdit.d.ts +7 -0
  65. package/build/components/UI/CAD/common/SectionHeader.d.ts +9 -0
  66. package/build/components/UI/CAD/common/primitives.d.ts +36 -0
  67. package/build/components/UI/CAD/common/reveal.d.ts +12 -0
  68. package/build/components/UI/CAD/hooks/index.d.ts +13 -0
  69. package/build/components/UI/CAD/hooks/useContextMenuInteraction.d.ts +7 -0
  70. package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +4 -0
  71. package/build/components/UI/CAD/hooks/useCurrentInstance.d.ts +2 -0
  72. package/build/components/UI/CAD/hooks/useCurrentProduct.d.ts +2 -0
  73. package/build/components/UI/CAD/hooks/useEditMode.d.ts +40 -0
  74. package/build/components/UI/CAD/hooks/useFeatureCount.d.ts +6 -0
  75. package/build/components/UI/CAD/hooks/useGlobalMateInfo.d.ts +6 -0
  76. package/build/components/UI/CAD/hooks/useHasPending.d.ts +27 -0
  77. package/build/components/UI/CAD/hooks/useIsDisabled.d.ts +2 -0
  78. package/build/components/UI/CAD/hooks/useIsLoading.d.ts +25 -0
  79. package/build/components/UI/CAD/hooks/useIsSketchActive.d.ts +26 -0
  80. package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +12 -0
  81. package/build/components/UI/CAD/hooks/useOperationSequence.d.ts +29 -0
  82. package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +8 -0
  83. package/build/components/UI/CAD/hooks/useRoot.d.ts +2 -0
  84. package/build/components/UI/CAD/index.d.ts +27 -0
  85. package/build/components/UI/CAD/plugins/ProductManagement/ProdTable.d.ts +10 -0
  86. package/build/components/UI/CAD/plugins/ProductManagement/Root.d.ts +11 -0
  87. package/build/components/UI/CAD/plugins/ProductManagement/View.d.ts +11 -0
  88. package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +34 -0
  89. package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +4 -0
  90. package/build/components/UI/CAD/plugins/ProductManagement/useContextMenuItems.d.ts +4 -0
  91. package/build/components/UI/CAD/plugins/SessionManagement/Root.d.ts +11 -0
  92. package/build/components/UI/CAD/plugins/SessionManagement/index.d.ts +36 -0
  93. package/build/components/UI/CAD/plugins/SessionManagement/types.d.ts +3 -0
  94. package/build/components/UI/CAD/store/CADActions.d.ts +29 -0
  95. package/build/components/UI/CAD/store/CADStore.d.ts +68 -0
  96. package/build/components/UI/CAD/store/instances.d.ts +7 -0
  97. package/build/components/UI/Readfile.d.ts +39 -0
  98. package/build/components/UI/ThemeVars.d.ts +6 -0
  99. package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +8 -0
  100. package/build/components/UI/editors/BooleanEditor/index.d.ts +2 -0
  101. package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +3 -0
  102. package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +11 -0
  103. package/build/components/UI/editors/CSysEditor/index.d.ts +2 -0
  104. package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +9 -0
  105. package/build/components/UI/editors/ColorEditor/ColorEditor.d.ts +12 -0
  106. package/build/components/UI/editors/ColorEditor/index.d.ts +2 -0
  107. package/build/components/UI/editors/ColorEditor/useColorParam.d.ts +9 -0
  108. package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +20 -0
  109. package/build/components/UI/editors/ExpressionEditor/index.d.ts +2 -0
  110. package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +5 -0
  111. package/build/components/UI/editors/NumberEditor/Inputs.d.ts +18 -0
  112. package/build/components/UI/editors/NumberEditor/Mentions.d.ts +10 -0
  113. package/build/components/UI/editors/NumberEditor/NumOrExpr.d.ts +12 -0
  114. package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +12 -0
  115. package/build/components/UI/editors/NumberEditor/index.d.ts +2 -0
  116. package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +5 -0
  117. package/build/components/UI/editors/PointEditor/PointEditor.d.ts +10 -0
  118. package/build/components/UI/editors/PointEditor/index.d.ts +2 -0
  119. package/build/components/UI/editors/PointEditor/usePointParam.d.ts +5 -0
  120. package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +12 -0
  121. package/build/components/UI/editors/RefsEditors/MateEditor.d.ts +13 -0
  122. package/build/components/UI/editors/RefsEditors/MateOrientationEditor.d.ts +9 -0
  123. package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +24 -0
  124. package/build/components/UI/editors/RefsEditors/RefsEditor.d.ts +16 -0
  125. package/build/components/UI/editors/RefsEditors/index.d.ts +8 -0
  126. package/build/components/UI/editors/RefsEditors/pickers.d.ts +4 -0
  127. package/build/components/UI/editors/RefsEditors/useIdParam.d.ts +3 -0
  128. package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +19 -0
  129. package/build/components/UI/editors/RefsEditors/useModes.d.ts +11 -0
  130. package/build/components/UI/editors/RefsEditors/useRefsParam.d.ts +3 -0
  131. package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +18 -0
  132. package/build/components/UI/editors/ToleranceEditor/ToleranceEditor.d.ts +7 -0
  133. package/build/components/UI/editors/ToleranceEditor/index.d.ts +2 -0
  134. package/build/components/UI/editors/ToleranceEditor/useToleranceParam.d.ts +3 -0
  135. package/build/components/UI/editors/TypeEditor/TypeEditor.d.ts +10 -0
  136. package/build/components/UI/editors/TypeEditor/index.d.ts +2 -0
  137. package/build/components/UI/editors/TypeEditor/useTypeParam.d.ts +3 -0
  138. package/build/components/UI/editors/TypeWrapper.d.ts +6 -0
  139. package/build/components/UI/editors/Wrapper.d.ts +16 -0
  140. package/build/components/UI/editors/useParam.d.ts +20 -0
  141. package/build/components/UI/editors/useValidation.d.ts +4 -0
  142. package/build/components/graphics/Badge.d.ts +70 -0
  143. package/build/components/graphics/CSysDisplay.d.ts +108 -0
  144. package/build/components/graphics/CompositeCurveObj.d.ts +33 -0
  145. package/build/components/graphics/GeometryOverrides/GeometryOverridesManager.d.ts +41 -0
  146. package/build/components/graphics/GeometryOverrides/GeometryOverridesStore.d.ts +28 -0
  147. package/build/components/graphics/GeometryOverrides/index.d.ts +2 -0
  148. package/build/components/graphics/GeometryOverrides/useOverrideGeometryColor.d.ts +36 -0
  149. package/build/components/graphics/HUD.d.ts +44 -0
  150. package/build/components/graphics/HoveredConstraintDisplay.d.ts +24 -0
  151. package/build/components/graphics/InfinityPlane.d.ts +4 -0
  152. package/build/components/graphics/Outlines/AAPass.d.ts +8 -0
  153. package/build/components/graphics/Outlines/IDPass.d.ts +12 -0
  154. package/build/components/graphics/Outlines/Outline.d.ts +62 -0
  155. package/build/components/graphics/Outlines/OutlineEffect.d.ts +48 -0
  156. package/build/components/graphics/Outlines/OutlineMaterial.d.ts +9 -0
  157. package/build/components/graphics/Outlines/WidenPass.d.ts +17 -0
  158. package/build/components/graphics/PluginGeometryBounds.d.ts +40 -0
  159. package/build/components/graphics/SelectableMate.d.ts +3 -0
  160. package/build/components/graphics/SelectedMateObj.d.ts +54 -0
  161. package/build/components/graphics/StageLook.d.ts +51 -0
  162. package/build/components/graphics/WorkAxisObj.d.ts +33 -0
  163. package/build/components/graphics/WorkCSysObj.d.ts +33 -0
  164. package/build/components/graphics/WorkCoordSystemObj.d.ts +32 -0
  165. package/build/components/graphics/WorkPlaneObj.d.ts +33 -0
  166. package/build/components/graphics/WorkPointObj.d.ts +57 -0
  167. package/build/components/graphics/graphics.d.ts +61 -0
  168. package/build/components/graphics/utils/MatePathTransform.d.ts +10 -0
  169. package/build/components/graphics/utils/useCsysMatrix.d.ts +4 -0
  170. package/build/components/utils/CompValidation/ErrorBoundary.d.ts +28 -0
  171. package/build/components/utils/CompValidation/validators/CSysDisplayValidator.d.ts +12 -0
  172. package/build/components/utils/CompValidation/validators/DrawingValidator.d.ts +12 -0
  173. package/build/components/utils/CompValidation/validators/ExpressionsValidator.d.ts +12 -0
  174. package/build/components/utils/CompValidation/validators/FPluginValidator.d.ts +16 -0
  175. package/build/components/utils/CompValidation/validators/FeatureListValidator.d.ts +12 -0
  176. package/build/components/utils/CompValidation/validators/ProductManagementValidator.d.ts +14 -0
  177. package/build/components/utils/CompValidation/verifiers.d.ts +32 -0
  178. package/build/components/utils/FtVisibilityController.d.ts +26 -0
  179. package/build/elements/index.d.ts +162 -0
  180. package/build/icons/axes.d.ts +73 -0
  181. package/build/icons/draw.d.ts +75 -0
  182. package/build/icons/features.d.ts +71 -0
  183. package/build/icons/glyphs.d.ts +10 -0
  184. package/build/icons/index.d.ts +152 -0
  185. package/build/icons/legacy.d.ts +159 -0
  186. package/build/icons/mates.d.ts +26 -0
  187. package/build/icons/params.d.ts +77 -0
  188. package/build/icons/refs.d.ts +61 -0
  189. package/build/icons/sheets.d.ts +302 -0
  190. package/build/icons/sketch.d.ts +102 -0
  191. package/build/icons/types.d.ts +74 -0
  192. package/build/icons/ui.d.ts +114 -0
  193. package/build/icons.cjs.js +1751 -0
  194. package/build/icons.js +1742 -0
  195. package/build/index.cjs.js +44948 -0
  196. package/build/index.d.ts +115 -0
  197. package/build/index.js +44800 -0
  198. package/build/plugins/AppearanceEditor/Root.d.ts +12 -0
  199. package/build/plugins/AppearanceEditor/index.d.ts +42 -0
  200. package/build/plugins/Boolean/Root.d.ts +11 -0
  201. package/build/plugins/Boolean/index.d.ts +39 -0
  202. package/build/plugins/BoundingBoxInfo/Root.d.ts +12 -0
  203. package/build/plugins/BoundingBoxInfo/View.d.ts +11 -0
  204. package/build/plugins/BoundingBoxInfo/index.d.ts +35 -0
  205. package/build/plugins/Box/Root.d.ts +11 -0
  206. package/build/plugins/Box/index.d.ts +34 -0
  207. package/build/plugins/Chamfer/Root.d.ts +11 -0
  208. package/build/plugins/Chamfer/index.d.ts +35 -0
  209. package/build/plugins/CircularPattern/Root.d.ts +11 -0
  210. package/build/plugins/CircularPattern/index.d.ts +35 -0
  211. package/build/plugins/CompositeCurve/Root.d.ts +11 -0
  212. package/build/plugins/CompositeCurve/View.d.ts +11 -0
  213. package/build/plugins/CompositeCurve/index.d.ts +36 -0
  214. package/build/plugins/Cone/Root.d.ts +11 -0
  215. package/build/plugins/Cone/index.d.ts +36 -0
  216. package/build/plugins/Cylinder/Root.d.ts +11 -0
  217. package/build/plugins/Cylinder/index.d.ts +35 -0
  218. package/build/plugins/Dimensions/DimContext.d.ts +10 -0
  219. package/build/plugins/Dimensions/Root.d.ts +11 -0
  220. package/build/plugins/Dimensions/View.d.ts +11 -0
  221. package/build/plugins/Dimensions/graphics/DimGraphics.d.ts +7 -0
  222. package/build/plugins/Dimensions/graphics/DimensionSet.d.ts +8 -0
  223. package/build/plugins/Dimensions/graphics/primitives.d.ts +34 -0
  224. package/build/plugins/Dimensions/index.d.ts +34 -0
  225. package/build/plugins/Dimensions/utils.d.ts +5 -0
  226. package/build/plugins/EntityDeletion/Root.d.ts +11 -0
  227. package/build/plugins/EntityDeletion/index.d.ts +34 -0
  228. package/build/plugins/Expressions/Root.d.ts +11 -0
  229. package/build/plugins/Expressions/index.d.ts +34 -0
  230. package/build/plugins/Expressions/useContextMenuItems.d.ts +4 -0
  231. package/build/plugins/Extrusion/Root.d.ts +11 -0
  232. package/build/plugins/Extrusion/View.d.ts +11 -0
  233. package/build/plugins/Extrusion/index.d.ts +50 -0
  234. package/build/plugins/Fillet/Root.d.ts +11 -0
  235. package/build/plugins/Fillet/index.d.ts +35 -0
  236. package/build/plugins/HLConstraints/CircularPattern/Root.d.ts +11 -0
  237. package/build/plugins/HLConstraints/CircularPattern/View.d.ts +11 -0
  238. package/build/plugins/HLConstraints/CircularPattern/index.d.ts +38 -0
  239. package/build/plugins/HLConstraints/Cylindrical/Root.d.ts +11 -0
  240. package/build/plugins/HLConstraints/Cylindrical/View.d.ts +11 -0
  241. package/build/plugins/HLConstraints/Cylindrical/index.d.ts +37 -0
  242. package/build/plugins/HLConstraints/Fastened/Root.d.ts +11 -0
  243. package/build/plugins/HLConstraints/Fastened/View.d.ts +11 -0
  244. package/build/plugins/HLConstraints/Fastened/index.d.ts +37 -0
  245. package/build/plugins/HLConstraints/FastenedOrigin/Root.d.ts +11 -0
  246. package/build/plugins/HLConstraints/FastenedOrigin/View.d.ts +11 -0
  247. package/build/plugins/HLConstraints/FastenedOrigin/index.d.ts +37 -0
  248. package/build/plugins/HLConstraints/Gear/Root.d.ts +11 -0
  249. package/build/plugins/HLConstraints/Gear/View.d.ts +11 -0
  250. package/build/plugins/HLConstraints/Gear/index.d.ts +36 -0
  251. package/build/plugins/HLConstraints/Group/Root.d.ts +11 -0
  252. package/build/plugins/HLConstraints/Group/index.d.ts +34 -0
  253. package/build/plugins/HLConstraints/LinearPattern/Root.d.ts +11 -0
  254. package/build/plugins/HLConstraints/LinearPattern/View.d.ts +11 -0
  255. package/build/plugins/HLConstraints/LinearPattern/index.d.ts +38 -0
  256. package/build/plugins/HLConstraints/Parallel/Root.d.ts +11 -0
  257. package/build/plugins/HLConstraints/Parallel/View.d.ts +11 -0
  258. package/build/plugins/HLConstraints/Parallel/index.d.ts +37 -0
  259. package/build/plugins/HLConstraints/Planar/Root.d.ts +11 -0
  260. package/build/plugins/HLConstraints/Planar/View.d.ts +11 -0
  261. package/build/plugins/HLConstraints/Planar/index.d.ts +37 -0
  262. package/build/plugins/HLConstraints/Revolute/Root.d.ts +11 -0
  263. package/build/plugins/HLConstraints/Revolute/View.d.ts +11 -0
  264. package/build/plugins/HLConstraints/Revolute/index.d.ts +37 -0
  265. package/build/plugins/HLConstraints/Slider/Root.d.ts +11 -0
  266. package/build/plugins/HLConstraints/Slider/View.d.ts +11 -0
  267. package/build/plugins/HLConstraints/Slider/index.d.ts +37 -0
  268. package/build/plugins/HLConstraints/Spherical/Root.d.ts +11 -0
  269. package/build/plugins/HLConstraints/Spherical/View.d.ts +11 -0
  270. package/build/plugins/HLConstraints/Spherical/index.d.ts +36 -0
  271. package/build/plugins/HLConstraints/components/CSysDisplayWrapper.d.ts +7 -0
  272. package/build/plugins/HLConstraints/components/HLConstrIcon.d.ts +7 -0
  273. package/build/plugins/HLConstraints/components/LimitedValue.d.ts +12 -0
  274. package/build/plugins/HLConstraints/components/Limits.d.ts +25 -0
  275. package/build/plugins/HLConstraints/components/LimitsCollapse.d.ts +12 -0
  276. package/build/plugins/HLConstraints/validators.d.ts +2 -0
  277. package/build/plugins/Import/Root.d.ts +11 -0
  278. package/build/plugins/Import/index.d.ts +35 -0
  279. package/build/plugins/LinearPattern/Root.d.ts +11 -0
  280. package/build/plugins/LinearPattern/index.d.ts +36 -0
  281. package/build/plugins/Measure/Digits.d.ts +7 -0
  282. package/build/plugins/Measure/Root.d.ts +11 -0
  283. package/build/plugins/Measure/View.d.ts +15 -0
  284. package/build/plugins/Measure/config.d.ts +1 -0
  285. package/build/plugins/Measure/graphics/MeasureGraphics.d.ts +24 -0
  286. package/build/plugins/Measure/index.d.ts +39 -0
  287. package/build/plugins/Measure/utils.d.ts +2 -0
  288. package/build/plugins/Mirror/Root.d.ts +11 -0
  289. package/build/plugins/Mirror/index.d.ts +34 -0
  290. package/build/plugins/Revolve/Root.d.ts +11 -0
  291. package/build/plugins/Revolve/index.d.ts +37 -0
  292. package/build/plugins/Rotate/Root.d.ts +11 -0
  293. package/build/plugins/Rotate/index.d.ts +35 -0
  294. package/build/plugins/Sketch/Root/Constraints/Constraints.d.ts +2 -0
  295. package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +22 -0
  296. package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
  297. package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
  298. package/build/plugins/Sketch/Root/CopyPatterns.d.ts +2 -0
  299. package/build/plugins/Sketch/Root/Details.d.ts +2 -0
  300. package/build/plugins/Sketch/Root/Handlers.d.ts +2 -0
  301. package/build/plugins/Sketch/Root/PlaneSelection.d.ts +7 -0
  302. package/build/plugins/Sketch/Root/Position.d.ts +2 -0
  303. package/build/plugins/Sketch/Root/Regions.d.ts +2 -0
  304. package/build/plugins/Sketch/Root/Root.d.ts +11 -0
  305. package/build/plugins/Sketch/Root/RootContext.d.ts +7 -0
  306. package/build/plugins/Sketch/Root/SketchGroup.d.ts +15 -0
  307. package/build/plugins/Sketch/Root/index.d.ts +1 -0
  308. package/build/plugins/Sketch/Root/useContextMenuItems.d.ts +4 -0
  309. package/build/plugins/Sketch/Root/useLayoutSize.d.ts +11 -0
  310. package/build/plugins/Sketch/View/View.d.ts +11 -0
  311. package/build/plugins/Sketch/View/ViewContext.d.ts +8 -0
  312. package/build/plugins/Sketch/View/graphics/Constraints.d.ts +5 -0
  313. package/build/plugins/Sketch/View/graphics/IconGroups.d.ts +7 -0
  314. package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +20 -0
  315. package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
  316. package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
  317. package/build/plugins/Sketch/View/graphics/Merged/Bezier.d.ts +19 -0
  318. package/build/plugins/Sketch/View/graphics/Merged/BezierGeometry.d.ts +12 -0
  319. package/build/plugins/Sketch/View/graphics/Merged/BezierMaterial.d.ts +2 -0
  320. package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +9 -0
  321. package/build/plugins/Sketch/View/graphics/Merged/Line.d.ts +15 -0
  322. package/build/plugins/Sketch/View/graphics/Merged/LineGeometry.d.ts +2 -0
  323. package/build/plugins/Sketch/View/graphics/Merged/LineMaterial.d.ts +2 -0
  324. package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +16 -0
  325. package/build/plugins/Sketch/View/graphics/Merged/Point.d.ts +8 -0
  326. package/build/plugins/Sketch/View/graphics/Merged/Spline.d.ts +17 -0
  327. package/build/plugins/Sketch/View/graphics/Merged/SplineGeometry.d.ts +11 -0
  328. package/build/plugins/Sketch/View/graphics/Merged/SplineMaterial.d.ts +2 -0
  329. package/build/plugins/Sketch/View/graphics/MousePosition.d.ts +2 -0
  330. package/build/plugins/Sketch/View/graphics/Regions.d.ts +5 -0
  331. package/build/plugins/Sketch/View/graphics/TmpAngularDimension.d.ts +8 -0
  332. package/build/plugins/Sketch/View/graphics/graphics.d.ts +5 -0
  333. package/build/plugins/Sketch/View/graphics/hooks.d.ts +49 -0
  334. package/build/plugins/Sketch/View/graphics/primitives.d.ts +34 -0
  335. package/build/plugins/Sketch/View/graphics/scale.d.ts +6 -0
  336. package/build/plugins/Sketch/View/graphics/tmpGraphics.d.ts +3 -0
  337. package/build/plugins/Sketch/View/graphics/transform.d.ts +4 -0
  338. package/build/plugins/Sketch/View/handlers/CreateAngle.d.ts +3 -0
  339. package/build/plugins/Sketch/View/handlers/CreateConstraint.d.ts +10 -0
  340. package/build/plugins/Sketch/View/handlers/Drag.d.ts +3 -0
  341. package/build/plugins/Sketch/View/handlers/DrawArc.d.ts +3 -0
  342. package/build/plugins/Sketch/View/handlers/DrawCircle.d.ts +3 -0
  343. package/build/plugins/Sketch/View/handlers/DrawLine.d.ts +3 -0
  344. package/build/plugins/Sketch/View/handlers/DrawNurbs.d.ts +3 -0
  345. package/build/plugins/Sketch/View/handlers/DrawPoint.d.ts +3 -0
  346. package/build/plugins/Sketch/View/handlers/DrawRectangle.d.ts +3 -0
  347. package/build/plugins/Sketch/View/handlers/Fillet.d.ts +3 -0
  348. package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +33 -0
  349. package/build/plugins/Sketch/View/handlers/Hover.d.ts +3 -0
  350. package/build/plugins/Sketch/View/handlers/SSelect.d.ts +3 -0
  351. package/build/plugins/Sketch/View/handlers/Split.d.ts +3 -0
  352. package/build/plugins/Sketch/View/handlers/Trim.d.ts +3 -0
  353. package/build/plugins/Sketch/View/handlers/Use.d.ts +3 -0
  354. package/build/plugins/Sketch/View/handlers/constraintCreation.d.ts +10 -0
  355. package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +24 -0
  356. package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
  357. package/build/plugins/Sketch/View/handlers/snapper.d.ts +11 -0
  358. package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +20 -0
  359. package/build/plugins/Sketch/View/index.d.ts +1 -0
  360. package/build/plugins/Sketch/constants.d.ts +5 -0
  361. package/build/plugins/Sketch/description.d.ts +7 -0
  362. package/build/plugins/Sketch/index.d.ts +35 -0
  363. package/build/plugins/Sketch/resources.d.ts +5 -0
  364. package/build/plugins/Sketch/types.d.ts +148 -0
  365. package/build/plugins/Sketch/utils/Interaction.d.ts +7 -0
  366. package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
  367. package/build/plugins/Sketch/utils/getSketchState.d.ts +3 -0
  368. package/build/plugins/Sketch/utils/useSketchRegions.d.ts +2 -0
  369. package/build/plugins/Sketch/utils/useSketchState.d.ts +3 -0
  370. package/build/plugins/Slice/Root.d.ts +11 -0
  371. package/build/plugins/Slice/index.d.ts +34 -0
  372. package/build/plugins/SliceBySheet/Root.d.ts +11 -0
  373. package/build/plugins/SliceBySheet/index.d.ts +35 -0
  374. package/build/plugins/Sphere/Root.d.ts +11 -0
  375. package/build/plugins/Sphere/index.d.ts +35 -0
  376. package/build/plugins/TransformByCsys/Root.d.ts +11 -0
  377. package/build/plugins/TransformByCsys/index.d.ts +35 -0
  378. package/build/plugins/Translate/Root.d.ts +11 -0
  379. package/build/plugins/Translate/index.d.ts +35 -0
  380. package/build/plugins/Twist/Root.d.ts +11 -0
  381. package/build/plugins/Twist/View.d.ts +11 -0
  382. package/build/plugins/Twist/index.d.ts +48 -0
  383. package/build/plugins/WorkAxis/Root.d.ts +11 -0
  384. package/build/plugins/WorkAxis/View.d.ts +11 -0
  385. package/build/plugins/WorkAxis/index.d.ts +37 -0
  386. package/build/plugins/WorkCSys/Root.d.ts +11 -0
  387. package/build/plugins/WorkCSys/View.d.ts +11 -0
  388. package/build/plugins/WorkCSys/index.d.ts +53 -0
  389. package/build/plugins/WorkCoordSystem/Root.d.ts +11 -0
  390. package/build/plugins/WorkCoordSystem/View.d.ts +11 -0
  391. package/build/plugins/WorkCoordSystem/index.d.ts +55 -0
  392. package/build/plugins/WorkPlane/Root.d.ts +11 -0
  393. package/build/plugins/WorkPlane/View.d.ts +11 -0
  394. package/build/plugins/WorkPlane/index.d.ts +38 -0
  395. package/build/plugins/WorkPlane/validators.d.ts +1 -0
  396. package/build/plugins/WorkPoint/Root.d.ts +11 -0
  397. package/build/plugins/WorkPoint/View.d.ts +11 -0
  398. package/build/plugins/WorkPoint/index.d.ts +38 -0
  399. package/build/plugins/components/PluginForm.d.ts +24 -0
  400. package/build/plugins/utils/useRefsReset.d.ts +2 -0
  401. package/build/session/identity.d.ts +46 -0
  402. package/build/session/sessionClient.d.ts +140 -0
  403. package/build/session/types.d.ts +52 -0
  404. package/build/session/viewpoints.d.ts +90 -0
  405. package/build/theme/AppStyle.d.ts +33 -0
  406. package/build/theme/fonts/mono.d.ts +29 -0
  407. package/build/theme/stage.d.ts +148 -0
  408. package/build/theme/styles/antdChoices.d.ts +1 -0
  409. package/build/theme/styles/antdControls.d.ts +1 -0
  410. package/build/theme/styles/antdSurfaces.d.ts +1 -0
  411. package/build/theme/styles/editors.d.ts +1 -0
  412. package/build/theme/styles/fields.d.ts +1 -0
  413. package/build/theme/styles/frame.d.ts +1 -0
  414. package/build/theme/styles/panes.d.ts +1 -0
  415. package/build/theme/styles/parts.d.ts +2 -0
  416. package/build/theme/styles/rest.d.ts +1 -0
  417. package/build/theme/styles/sketch.d.ts +1 -0
  418. package/build/theme/styles/toolbar.d.ts +1 -0
  419. package/build/theme/styles/tools.d.ts +1 -0
  420. package/build/theme/styles/windows.d.ts +1 -0
  421. package/build/theme/themeStore.d.ts +305 -0
  422. package/build/types/jsx-compat.d.ts +8 -0
  423. package/build/types.d.ts +16 -0
  424. package/build/utils/FileUtils.d.ts +20 -0
  425. package/build/utils/bezierMatrices.d.ts +3 -0
  426. package/build/utils/conversionUtils.d.ts +78 -0
  427. package/build/utils/cubicSplineInterpolation.d.ts +5 -0
  428. package/build/utils/defaultValues.d.ts +3 -0
  429. package/build/utils/drawing/index.d.ts +3 -0
  430. package/build/utils/drawing/useDrawingArr.d.ts +10 -0
  431. package/build/utils/drawing/useDrawingCCId.d.ts +10 -0
  432. package/build/utils/drawing/useDrawingStr.d.ts +10 -0
  433. package/build/utils/getHighlightedColor.d.ts +6 -0
  434. package/build/utils/getMatePath.d.ts +2 -0
  435. package/build/utils/getMateRefIds.d.ts +30 -0
  436. package/build/utils/helpers.d.ts +19 -0
  437. package/build/utils/mateUtils.d.ts +35 -0
  438. package/build/utils/nurbsUtils.d.ts +35 -0
  439. package/build/utils/selection/filters.d.ts +12 -0
  440. package/build/utils/selection/scopes/mateSelection.d.ts +49 -0
  441. package/build/utils/selection/scopes/treeObjInteraction.d.ts +74 -0
  442. package/build/utils/selection/useSelectorsOrder.d.ts +12 -0
  443. package/build/utils/sketchIntersectionUtils.d.ts +139 -0
  444. package/build/utils/sketchUtils.d.ts +235 -0
  445. package/build/utils/useAllObjects.d.ts +31 -0
  446. package/build/utils/useIsUncommited.d.ts +2 -0
  447. package/build/utils/useRetainVisibility.d.ts +2 -0
  448. package/build/utils/useScale.d.ts +5 -0
  449. package/build/utils/validation.d.ts +11 -0
  450. package/doc/api/advanced/session.md +646 -0
  451. package/doc/api/advanced/utilities.md +1306 -0
  452. package/doc/api/assembly-constraints.md +340 -0
  453. package/doc/api/feature-plugins.md +613 -0
  454. package/doc/api/graphics.md +848 -0
  455. package/doc/api/hooks.md +300 -0
  456. package/doc/api/icons.md +812 -0
  457. package/doc/api/index.md +87 -0
  458. package/doc/api/other.md +369 -0
  459. package/doc/api/panels.md +754 -0
  460. package/doc/api/theme.md +551 -0
  461. package/doc/api/tool-plugins.md +191 -0
  462. package/doc/api/ui-elements.md +310 -0
  463. package/doc/api/work-geometry.md +154 -0
  464. package/icons/package.json +8 -0
  465. package/package.json +109 -4
  466. package/tools/fonts/brotli.py +29 -0
  467. package/tools/fonts/build.py +76 -0
  468. package/tools/icons/preview.mjs +74 -0
  469. package/tsconfig.build.json +16 -0
  470. package/typedoc.json +18 -0
  471. package/vitest.config.mts +25 -0
@@ -0,0 +1,1306 @@
1
+ # Utilities
2
+
3
+ Helpers for sketches, mates and selections, and conversions into the arguments of ClassCAD's API.
4
+
5
+ ## Functions
6
+
7
+ ### createTreeObjSelItem() {#createtreeobjselitem}
8
+
9
+ ```ts
10
+ function createTreeObjSelItem(productId, object): SelectedItem;
11
+ ```
12
+
13
+ Makes the selection item of a structure object ([TreeObjScope](#treeobjscope)), to select it into the active field.
14
+
15
+ Its label is the capitals of the object's class (`WP` for a work plane); it goes when the object leaves the tree.
16
+
17
+ #### Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | :------ | :------ | :------ |
21
+ | `productId` | `number` | The product the object is picked in: the current product. |
22
+ | `object` | `ScgObject` | The object, from the drawing's structure tree. |
23
+
24
+ #### Returns
25
+
26
+ `SelectedItem`
27
+
28
+ ***
29
+
30
+ ### getMateRefIds() {#getmaterefids}
31
+
32
+ ```ts
33
+ function getMateRefIds(drawingId, constrId): number[] | undefined;
34
+ ```
35
+
36
+ Finds the instances of the current assembly that an assembly constraint joins: the ones its two mates are in.
37
+
38
+ A mate's path leads from an instance of the current assembly down to the coordinate system the mate is on; a mate
39
+ whose path or coordinate system is gone counts for nothing. Buerligons outlines the instances while the constraint
40
+ is under the pointer.
41
+
42
+ #### Parameters
43
+
44
+ | Parameter | Type | Description |
45
+ | :------ | :------ | :------ |
46
+ | `drawingId` | `DrawingID` | The drawing. |
47
+ | `constrId` | `number` | The constraint (one with `firstRefMate` and `secondRefMate`). |
48
+
49
+ #### Returns
50
+
51
+ `number`[] \| `undefined`
52
+
53
+ The ids of the instances (children of the current instance), or `undefined` where neither mate is valid.
54
+
55
+ #### Example
56
+
57
+ ```tsx
58
+ import { createInfo, getDrawing } from '@classcad/sdkjs'
59
+ import type { DrawingID, ObjectID } from '@classcad/sdkjs'
60
+ import { getMateRefIds } from '@classcad/react-cad'
61
+
62
+ // selects the two instances a constraint joins, as Buerligons outlines them
63
+ function selectJoined(drawingId: DrawingID, constraintId: ObjectID) {
64
+ const drawing = getDrawing(drawingId)
65
+ const joined = getMateRefIds(drawingId, constraintId) ?? []
66
+ drawing.api.interaction.setSelected(joined.map((id) => createInfo({ objectId: id, prodRefId: id })))
67
+ }
68
+ ```
69
+
70
+ ## Objects
71
+
72
+ ### MateScope {#matescope}
73
+
74
+ ```ts
75
+ const MateScope: "HLConstraintScope" = 'HLConstraintScope';
76
+ ```
77
+
78
+ The selection scope of a mate picked into an assembly constraint's field: a work coordinate system of an instance.
79
+
80
+ An item of this scope has as its data `{ path: ObjectID[], csys: ScgObject, flip: FlipType, reorient: ReorientedType }`:
81
+ the instances that lead to the coordinate system, the coordinate system, and how the mate lies on it. The mates
82
+ [CSysDisplay](../graphics.md#csysdisplay) shows are picked this way.
83
+
84
+ #### Example
85
+
86
+ ```tsx
87
+ import { getDrawing } from '@classcad/sdkjs'
88
+ import type { DrawingID, SelectorID } from '@classcad/sdkjs'
89
+ import { MateScope } from '@classcad/react-cad'
90
+
91
+ // what a constraint's field holds: the mate's coordinate system, and how the mate lies on it
92
+ function describeMate(drawingId: DrawingID, selectorId: SelectorID) {
93
+ const item = getDrawing(drawingId).selection.refs[selectorId]?.items[0]
94
+ if (item?.scope !== MateScope) return 'no mate'
95
+ return `${item.data.csys.name}, flip ${item.data.flip}, turned ${item.data.reorient}`
96
+ }
97
+ ```
98
+
99
+ ***
100
+
101
+ ### TreeObjScope {#treeobjscope}
102
+
103
+ ```ts
104
+ const TreeObjScope: "TreeObjScope" = 'TreeObjScope';
105
+ ```
106
+
107
+ The selection scope of a structure object picked into a field: a feature, a sketch, a work plane, an instance.
108
+
109
+ A selector of a feature's field says with it whether it takes a tree object (`selection.isSelectable(TreeObjScope,
110
+ { object })`); an item of this scope ([createTreeObjSelItem](#createtreeobjselitem)) has the object as its data: `{ object: ScgObject }`.
111
+ The model tree's rows and the work geometry on the stage are picked this way.
112
+
113
+ #### Example
114
+
115
+ ```tsx
116
+ import { getDrawing } from '@classcad/sdkjs'
117
+ import type { DrawingID, ObjectID } from '@classcad/sdkjs'
118
+ import { createTreeObjSelItem, TreeObjScope } from '@classcad/react-cad'
119
+
120
+ // a click on a work plane of the app's own: it goes into the field that is picking, if the field takes it
121
+ function pickIntoField(drawingId: DrawingID, workPlaneId: ObjectID) {
122
+ const drawing = getDrawing(drawingId)
123
+ const selector = drawing.selection.refs[drawing.selection.active ?? '']
124
+ const object = drawing.structure.tree[workPlaneId]
125
+ const productId = drawing.structure.currentProduct
126
+ if (selector && productId && selector.isSelectable(TreeObjScope, { object })) {
127
+ drawing.api.selection.select(createTreeObjSelItem(productId, object))
128
+ }
129
+ }
130
+ ```
131
+
132
+ ## conversionUtils
133
+
134
+ Converts what react-cad's fields hold into the arguments of ClassCAD's `api.v1` calls: a mate, a body.
135
+
136
+ ### conversionUtils.mateV1() {#conversionutilsmatev1}
137
+
138
+ ```ts
139
+ function mateV1(mateV0): {
140
+ csys: number | undefined;
141
+ flip: "Z" | "X" | "-X" | "Y" | "-Y" | "-Z";
142
+ path: number[] | undefined;
143
+ reorient: "0" | "90" | "180" | "270";
144
+ };
145
+ ```
146
+
147
+ A mate as `api.v1.assembly`'s constraint calls take it: its flip as `'X'` … `'-Z'`, its turn as `'0'` … `'270'`.
148
+
149
+ #### Parameters
150
+
151
+ | Parameter | Type | Description |
152
+ | :------ | :------ | :------ |
153
+ | `mateV0` | \{ `csys`: `number` \| `undefined`; `flip`: `FlipType`; `path`: `number`[] \| `undefined`; `reorient`: `ReorientedType`; \} | The mate as a constraint's field holds it: its path, its coordinate system, and its flip and turn as ClassCAD's numbers (`FlipType`, `ReorientedType`). |
154
+ | `mateV0.csys` | `number` \| `undefined` | The work coordinate system the mate is on. |
155
+ | `mateV0.flip` | `FlipType` | Which of its axes is the mate's main one, and which way (ClassCAD's number). |
156
+ | `mateV0.path` | `number`[] \| `undefined` | The instances that lead to the coordinate system. |
157
+ | `mateV0.reorient` | `ReorientedType` | How far the mate is turned about its main axis (ClassCAD's number). |
158
+
159
+ #### Returns
160
+
161
+ The same mate, with `flip` and `reorient` as the v1 API names them.
162
+
163
+ | Name | Type | Description |
164
+ | :------ | :------ | :------ |
165
+ | `csys` | `number` \| `undefined` | The work coordinate system the mate is on. |
166
+ | `flip` | `"Z"` \| `"X"` \| `"-X"` \| `"Y"` \| `"-Y"` \| `"-Z"` | Which of the coordinate system's axes is the mate's main one, and which way. |
167
+ | `path` | `number`[] \| `undefined` | The instances that lead to the coordinate system. |
168
+ | `reorient` | `"0"` \| `"90"` \| `"180"` \| `"270"` | How far the mate is turned about its main axis, in degrees. |
169
+
170
+ #### Example
171
+
172
+ ```tsx
173
+ import { createApi, FlipType, ReorientedType } from '@classcad/client'
174
+ import type { DrawingID, ObjectID } from '@classcad/sdkjs'
175
+ import { conversionUtils } from '@classcad/react-cad'
176
+
177
+ // a constraint's two mates as its dialog's fields hold them, written back to the constraint
178
+ const mate1 = { path: [nut], csys: nutCsys, flip: FlipType.FLIP_Z, reorient: ReorientedType.REORIENTED_0 }
179
+ const mate2 = { path: [bolt], csys: boltCsys, flip: FlipType.FLIP_Z_INV, reorient: ReorientedType.REORIENTED_90 }
180
+ await createApi(drawingId).v1.assembly.updateFastened({
181
+ id: constraintId,
182
+ mate1: conversionUtils.mateV1(mate1), // flip 'Z', reorient '0'
183
+ mate2: conversionUtils.mateV1(mate2), // flip '-Z', reorient '90'
184
+ })
185
+ ```
186
+
187
+ ***
188
+
189
+ ### conversionUtils.solidsV1() {#conversionutilssolidsv1}
190
+
191
+ ```ts
192
+ function solidsV1(drawingId, ids): {
193
+ id: string | number;
194
+ indices?: number[];
195
+ }[];
196
+ ```
197
+
198
+ Bodies as the v1 API references them ([solidV1](#conversionutilssolidv1)), such as an entity deletion's `targets`.
199
+
200
+ #### Parameters
201
+
202
+ | Parameter | Type | Description |
203
+ | :------ | :------ | :------ |
204
+ | `drawingId` | `DrawingID` | The drawing. |
205
+ | `ids` | `number`[] | The bodies' objects in the structure tree. |
206
+
207
+ #### Returns
208
+
209
+ \{
210
+ `id`: `string` \| `number`;
211
+ `indices?`: `number`[];
212
+ \}[]
213
+
214
+ #### Example
215
+
216
+ ```tsx
217
+ import { createApi } from '@classcad/client'
218
+ import type { DrawingID, ObjectID } from '@classcad/sdkjs'
219
+ import { conversionUtils } from '@classcad/react-cad'
220
+
221
+ // takes the selected bodies out of the part again: an entity deletion of them
222
+ async function deleteBodies(drawingId: DrawingID, partId: ObjectID, solidIds: ObjectID[]) {
223
+ const targets = conversionUtils.solidsV1(drawingId, solidIds)
224
+ await createApi(drawingId).v1.part.entityDeletion({ id: partId, name: 'Entity Deletion', targets })
225
+ }
226
+ ```
227
+
228
+ ***
229
+
230
+ ### conversionUtils.solidV1() {#conversionutilssolidv1}
231
+
232
+ ```ts
233
+ function solidV1(drawingId, id): {
234
+ id: string | number;
235
+ indices?: number[];
236
+ };
237
+ ```
238
+
239
+ A body as the v1 API references it: the feature that made it, and its place among the feature's bodies.
240
+
241
+ #### Parameters
242
+
243
+ | Parameter | Type | Description |
244
+ | :------ | :------ | :------ |
245
+ | `drawingId` | `DrawingID` | The drawing. |
246
+ | `id` | `number` | The body's object in the structure tree. |
247
+
248
+ #### Returns
249
+
250
+ `{ id }` with the feature's id, and `indices` where the feature made more than one body.
251
+
252
+ | Name | Type | Description |
253
+ | :------ | :------ | :------ |
254
+ | `id` | `string` \| `number` | The feature that made the body. |
255
+ | `indices?` | `number`[] | The body's place among the feature's bodies, where it made more than one. |
256
+
257
+ ## mateUtils
258
+
259
+ Helpers for the mates of an assembly: which of the assembly's instances a nested instance moves with.
260
+
261
+ ### mateUtils.getProductRigidSet() {#mateutilsgetproductrigidset}
262
+
263
+ ```ts
264
+ function getProductRigidSet(
265
+ drawingId,
266
+ instanceId,
267
+ rigidSets
268
+ ): number | undefined;
269
+ ```
270
+
271
+ Finds the rigid set an instance moves with: the instance of the current assembly it is in (or the current product
272
+ itself, for one of its own), if that is one of `rigidSets`.
273
+
274
+ An assembly's constraints hold its own instances, and what is nested in one of them moves with it. Buerligons asks
275
+ so when a mate under the pointer is to be dragged: only the instances a selector allows move.
276
+
277
+ #### Parameters
278
+
279
+ | Parameter | Type | Description |
280
+ | :------ | :------ | :------ |
281
+ | `drawingId` | `DrawingID` | The drawing. |
282
+ | `instanceId` | `number` | An instance (a product reference) in the current assembly, at any depth. |
283
+ | `rigidSets` | `number`[] | The rigid sets to look in: instances of the current assembly, or the current product. |
284
+
285
+ #### Returns
286
+
287
+ `number` \| `undefined`
288
+
289
+ The rigid set, or `undefined` where it is not one of `rigidSets` (or there is no drawing).
290
+
291
+ #### Example
292
+
293
+ ```tsx
294
+ import { getDrawing } from '@classcad/sdkjs'
295
+ import type { DrawingID, ObjectID } from '@classcad/sdkjs'
296
+ import { mateUtils } from '@classcad/react-cad'
297
+
298
+ // which of the current assembly's instances moves when a nested instance under the pointer is dragged
299
+ function instanceToDrag(drawingId: DrawingID, hoveredInstance: ObjectID, movable: ObjectID[]) {
300
+ const rigidSet = mateUtils.getProductRigidSet(drawingId, hoveredInstance, movable)
301
+ if (rigidSet === undefined) return null // it moves with nothing that may move
302
+ return getDrawing(drawingId).structure.tree[rigidSet]
303
+ }
304
+ ```
305
+
306
+ ## sketchIntersectionUtils
307
+
308
+ Where a sketch's lines, arcs and circles cross one another, in the plane of the sketch: what the sketcher's trim
309
+ and split cut at.
310
+
311
+ A curve is given by its geometry ({@link CCLineInfo}, {@link CCArcInfo}, {@link CCCircleInfo}), in the sketch's
312
+ coordinates (z is 0). A place on a curve is its parameter `t`: 0 at a line's or an arc's start, 1 at its end (on a
313
+ circle, a turn from the X axis is 1). The `intersect…` functions return the parameters of the crossings on either
314
+ curve, `[onFirst, onSecond]`. A crossing at an end of a curve does not count on that curve (a line that ends on
315
+ another cuts it there, but is not cut itself).
316
+
317
+ **Example**
318
+
319
+ ```tsx
320
+ import * as THREE from 'three'
321
+ import { sketchIntersectionUtils as xu } from '@classcad/react-cad'
322
+
323
+ // two lines of a sketch that cross: where, on either, and the point itself
324
+ const line = (x0: number, y0: number, x1: number, y1: number): xu.CCLineInfo => ({
325
+ start: new THREE.Vector3(x0, y0, 0),
326
+ end: new THREE.Vector3(x1, y1, 0),
327
+ dir: new THREE.Vector3(x1 - x0, y1 - y0, 0),
328
+ })
329
+ const a = line(0, 0, 10, 10)
330
+ const b = line(0, 10, 10, 0)
331
+ const [onA, onB] = xu.intersectLineLine(a, b) // [[0.5], [0.5]]
332
+ const crossing = xu.getParameterizedPosition(onA[0], a) // (5, 5, 0)
333
+ ```
334
+
335
+ ### sketchIntersectionUtils.CCArcInfo {#sketchintersectionutilsccarcinfo}
336
+
337
+ ```ts
338
+ type sketchIntersectionUtils.CCArcInfo = {
339
+ angularLength: number;
340
+ center: THREE.Vector3;
341
+ clockwise: boolean;
342
+ end: THREE.Vector3;
343
+ endAngle: number;
344
+ radius: number;
345
+ start: THREE.Vector3;
346
+ startAngle: number;
347
+ };
348
+ ```
349
+
350
+ An arc of a sketch.
351
+
352
+ #### Properties
353
+
354
+ | Property | Type | Description |
355
+ | :------ | :------ | :------ |
356
+ | <a id="property-angularlength"></a> `angularLength` | `number` | The angle it spans: `endAngle - startAngle`, negative where it runs clockwise. |
357
+ | <a id="property-center"></a> `center` | `THREE.Vector3` | Its center. |
358
+ | <a id="property-clockwise"></a> `clockwise` | `boolean` | Whether it runs clockwise from its start to its end. |
359
+ | <a id="property-end"></a> `end` | `THREE.Vector3` | Its end. |
360
+ | <a id="property-endangle"></a> `endAngle` | `number` | The angle of its end, in radians, a turn on or back where needed to go the arc's way. |
361
+ | <a id="property-radius"></a> `radius` | `number` | Its radius. |
362
+ | <a id="property-start"></a> `start` | `THREE.Vector3` | Its start. |
363
+ | <a id="property-startangle"></a> `startAngle` | `number` | The angle of its start about the center, in radians. |
364
+
365
+ ***
366
+
367
+ ### sketchIntersectionUtils.CCCircleInfo {#sketchintersectionutilscccircleinfo}
368
+
369
+ ```ts
370
+ type sketchIntersectionUtils.CCCircleInfo = {
371
+ center: THREE.Vector3;
372
+ radius: number;
373
+ };
374
+ ```
375
+
376
+ A circle of a sketch.
377
+
378
+ #### Properties
379
+
380
+ | Property | Type | Description |
381
+ | :------ | :------ | :------ |
382
+ | <a id="property-center-1"></a> `center` | `THREE.Vector3` | Its center. |
383
+ | <a id="property-radius-1"></a> `radius` | `number` | Its radius. |
384
+
385
+ ***
386
+
387
+ ### sketchIntersectionUtils.CCLineInfo {#sketchintersectionutilscclineinfo}
388
+
389
+ ```ts
390
+ type sketchIntersectionUtils.CCLineInfo = {
391
+ dir: THREE.Vector3;
392
+ end: THREE.Vector3;
393
+ start: THREE.Vector3;
394
+ };
395
+ ```
396
+
397
+ A line of a sketch.
398
+
399
+ #### Properties
400
+
401
+ | Property | Type | Description |
402
+ | :------ | :------ | :------ |
403
+ | <a id="property-dir"></a> `dir` | `THREE.Vector3` | From its start to its end: `end - start`. |
404
+ | <a id="property-end-1"></a> `end` | `THREE.Vector3` | Its end. |
405
+ | <a id="property-start-1"></a> `start` | `THREE.Vector3` | Its start. |
406
+
407
+ ***
408
+
409
+ ### sketchIntersectionUtils.CCSplineInfo {#sketchintersectionutilsccsplineinfo}
410
+
411
+ ```ts
412
+ type sketchIntersectionUtils.CCSplineInfo = {
413
+ spans: {
414
+ cw: number[];
415
+ cx: number[];
416
+ cy: number[];
417
+ pw: number[];
418
+ px: number[];
419
+ py: number[];
420
+ tMax: number;
421
+ tMin: number;
422
+ }[];
423
+ };
424
+ ```
425
+
426
+ A spline of a sketch.
427
+
428
+ #### Properties
429
+
430
+ | Property | Type |
431
+ | :------ | :------ |
432
+ | <a id="property-spans"></a> `spans` | \{ `cw`: `number`[]; `cx`: `number`[]; `cy`: `number`[]; `pw`: `number`[]; `px`: `number`[]; `py`: `number`[]; `tMax`: `number`; `tMin`: `number`; \}[] |
433
+
434
+ ***
435
+
436
+ ### sketchIntersectionUtils.getNormalizedPosition() {#sketchintersectionutilsgetnormalizedposition}
437
+
438
+ ```ts
439
+ function getNormalizedPosition(point, sketchObject): number;
440
+ ```
441
+
442
+ The parameter of a point on a curve: 0 at its start, 1 at its end (on a circle, a turn from the X axis is 1).
443
+
444
+ The point is taken to be on the curve. On a line it is the signed distance from the start along the line, over
445
+ the line's length; on an arc, the angle from its start over the angle it spans (a point beside the arc comes out
446
+ below 0 or above 1, whichever end is closer).
447
+
448
+ #### Parameters
449
+
450
+ | Parameter | Type | Description |
451
+ | :------ | :------ | :------ |
452
+ | `point` | `Vector3` | A point on the curve. |
453
+ | `sketchObject` | [`sketchIntersectionUtils.SketchObjInfo`](#sketchintersectionutilssketchobjinfo) | The curve. |
454
+
455
+ #### Returns
456
+
457
+ `number`
458
+
459
+ ***
460
+
461
+ ### sketchIntersectionUtils.getParameterizedPosition() {#sketchintersectionutilsgetparameterizedposition}
462
+
463
+ ```ts
464
+ function getParameterizedPosition(t, sketchObject): Vector3;
465
+ ```
466
+
467
+ The point at a parameter of a curve: the inverse of [getNormalizedPosition](#sketchintersectionutilsgetnormalizedposition).
468
+
469
+ #### Parameters
470
+
471
+ | Parameter | Type | Description |
472
+ | :------ | :------ | :------ |
473
+ | `t` | `number` | The parameter: 0 at the curve's start, 1 at its end. |
474
+ | `sketchObject` | [`sketchIntersectionUtils.SketchObjInfo`](#sketchintersectionutilssketchobjinfo) | The curve. |
475
+
476
+ #### Returns
477
+
478
+ `Vector3`
479
+
480
+ ***
481
+
482
+ ### sketchIntersectionUtils.intersectArcArc() {#sketchintersectionutilsintersectarcarc}
483
+
484
+ ```ts
485
+ function intersectArcArc(arc1, arc2): number[][];
486
+ ```
487
+
488
+ Where two arcs cross.
489
+
490
+ #### Parameters
491
+
492
+ | Parameter | Type |
493
+ | :------ | :------ |
494
+ | `arc1` | [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) |
495
+ | `arc2` | [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) |
496
+
497
+ #### Returns
498
+
499
+ `number`[][]
500
+
501
+ `[onArc1, onArc2]`: the parameters of the crossings on either arc.
502
+
503
+ ***
504
+
505
+ ### sketchIntersectionUtils.intersectArcCircle() {#sketchintersectionutilsintersectarccircle}
506
+
507
+ ```ts
508
+ function intersectArcCircle(arc, circle): number[][];
509
+ ```
510
+
511
+ Where an arc crosses a circle.
512
+
513
+ #### Parameters
514
+
515
+ | Parameter | Type |
516
+ | :------ | :------ |
517
+ | `arc` | [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) |
518
+ | `circle` | [`sketchIntersectionUtils.CCCircleInfo`](#sketchintersectionutilscccircleinfo) |
519
+
520
+ #### Returns
521
+
522
+ `number`[][]
523
+
524
+ `[onArc, onCircle]`: the parameters of the crossings on the arc, and on the circle.
525
+
526
+ ***
527
+
528
+ ### sketchIntersectionUtils.intersectArcSpline() {#sketchintersectionutilsintersectarcspline}
529
+
530
+ ```ts
531
+ function intersectArcSpline(arc, spline): number[][];
532
+ ```
533
+
534
+ #### Parameters
535
+
536
+ | Parameter | Type |
537
+ | :------ | :------ |
538
+ | `arc` | [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) |
539
+ | `spline` | [`sketchIntersectionUtils.CCSplineInfo`](#sketchintersectionutilsccsplineinfo) |
540
+
541
+ #### Returns
542
+
543
+ `number`[][]
544
+
545
+ ***
546
+
547
+ ### sketchIntersectionUtils.intersectCircleCircle() {#sketchintersectionutilsintersectcirclecircle}
548
+
549
+ ```ts
550
+ function intersectCircleCircle(circle1, circle2): number[][];
551
+ ```
552
+
553
+ Where two circles cross (arcs count as their whole circles here).
554
+
555
+ #### Parameters
556
+
557
+ | Parameter | Type |
558
+ | :------ | :------ |
559
+ | `circle1` | \| [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) \| [`sketchIntersectionUtils.CCCircleInfo`](#sketchintersectionutilscccircleinfo) |
560
+ | `circle2` | \| [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) \| [`sketchIntersectionUtils.CCCircleInfo`](#sketchintersectionutilscccircleinfo) |
561
+
562
+ #### Returns
563
+
564
+ `number`[][]
565
+
566
+ `[onCircle1, onCircle2]`: the parameters of the crossings on either circle.
567
+
568
+ ***
569
+
570
+ ### sketchIntersectionUtils.intersectCircleSpline() {#sketchintersectionutilsintersectcirclespline}
571
+
572
+ ```ts
573
+ function intersectCircleSpline(circle, spline): number[][];
574
+ ```
575
+
576
+ #### Parameters
577
+
578
+ | Parameter | Type |
579
+ | :------ | :------ |
580
+ | `circle` | \| [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) \| [`sketchIntersectionUtils.CCCircleInfo`](#sketchintersectionutilscccircleinfo) |
581
+ | `spline` | [`sketchIntersectionUtils.CCSplineInfo`](#sketchintersectionutilsccsplineinfo) |
582
+
583
+ #### Returns
584
+
585
+ `number`[][]
586
+
587
+ ***
588
+
589
+ ### sketchIntersectionUtils.intersectLineArc() {#sketchintersectionutilsintersectlinearc}
590
+
591
+ ```ts
592
+ function intersectLineArc(line, arc): number[][];
593
+ ```
594
+
595
+ Where a line crosses an arc.
596
+
597
+ #### Parameters
598
+
599
+ | Parameter | Type |
600
+ | :------ | :------ |
601
+ | `line` | [`sketchIntersectionUtils.CCLineInfo`](#sketchintersectionutilscclineinfo) |
602
+ | `arc` | [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) |
603
+
604
+ #### Returns
605
+
606
+ `number`[][]
607
+
608
+ `[onLine, onArc]`: the parameters of the crossings on the line, and on the arc.
609
+
610
+ ***
611
+
612
+ ### sketchIntersectionUtils.intersectLineCircle() {#sketchintersectionutilsintersectlinecircle}
613
+
614
+ ```ts
615
+ function intersectLineCircle(line, circle): number[][];
616
+ ```
617
+
618
+ Where a line crosses a circle (an arc counts as its whole circle here).
619
+
620
+ #### Parameters
621
+
622
+ | Parameter | Type |
623
+ | :------ | :------ |
624
+ | `line` | [`sketchIntersectionUtils.CCLineInfo`](#sketchintersectionutilscclineinfo) |
625
+ | `circle` | \| [`sketchIntersectionUtils.CCArcInfo`](#sketchintersectionutilsccarcinfo) \| [`sketchIntersectionUtils.CCCircleInfo`](#sketchintersectionutilscccircleinfo) |
626
+
627
+ #### Returns
628
+
629
+ `number`[][]
630
+
631
+ `[onLine, onCircle]`: the parameters of the crossings on the line, and on the circle.
632
+
633
+ ***
634
+
635
+ ### sketchIntersectionUtils.intersectLineLine() {#sketchintersectionutilsintersectlineline}
636
+
637
+ ```ts
638
+ function intersectLineLine(line1, line2): number[][];
639
+ ```
640
+
641
+ Where two lines cross.
642
+
643
+ #### Parameters
644
+
645
+ | Parameter | Type |
646
+ | :------ | :------ |
647
+ | `line1` | [`sketchIntersectionUtils.CCLineInfo`](#sketchintersectionutilscclineinfo) |
648
+ | `line2` | [`sketchIntersectionUtils.CCLineInfo`](#sketchintersectionutilscclineinfo) |
649
+
650
+ #### Returns
651
+
652
+ `number`[][]
653
+
654
+ `[onLine1, onLine2]`: the parameters of the crossing on either line (none, or one).
655
+
656
+ ***
657
+
658
+ ### sketchIntersectionUtils.intersectLineSpline() {#sketchintersectionutilsintersectlinespline}
659
+
660
+ ```ts
661
+ function intersectLineSpline(line, spline): number[][];
662
+ ```
663
+
664
+ #### Parameters
665
+
666
+ | Parameter | Type |
667
+ | :------ | :------ |
668
+ | `line` | [`sketchIntersectionUtils.CCLineInfo`](#sketchintersectionutilscclineinfo) |
669
+ | `spline` | [`sketchIntersectionUtils.CCSplineInfo`](#sketchintersectionutilsccsplineinfo) |
670
+
671
+ #### Returns
672
+
673
+ `number`[][]
674
+
675
+ ***
676
+
677
+ ### sketchIntersectionUtils.intersectSplineSpline() {#sketchintersectionutilsintersectsplinespline}
678
+
679
+ ```ts
680
+ function intersectSplineSpline(spline1, spline2): number[][];
681
+ ```
682
+
683
+ #### Parameters
684
+
685
+ | Parameter | Type |
686
+ | :------ | :------ |
687
+ | `spline1` | [`sketchIntersectionUtils.CCSplineInfo`](#sketchintersectionutilsccsplineinfo) |
688
+ | `spline2` | [`sketchIntersectionUtils.CCSplineInfo`](#sketchintersectionutilsccsplineinfo) |
689
+
690
+ #### Returns
691
+
692
+ `number`[][]
693
+
694
+ ***
695
+
696
+ ### sketchIntersectionUtils.SketchObjInfo {#sketchintersectionutilssketchobjinfo}
697
+
698
+ ```ts
699
+ type sketchIntersectionUtils.SketchObjInfo =
700
+ | sketchIntersectionUtils.CCLineInfo
701
+ | sketchIntersectionUtils.CCArcInfo
702
+ | sketchIntersectionUtils.CCCircleInfo
703
+ | sketchIntersectionUtils.CCSplineInfo;
704
+ ```
705
+
706
+ ## sketchUtils
707
+
708
+ Helpers for sketches: what a structure object is in a sketch, a sketch's curves and constraints, and how to look
709
+ at a sketch.
710
+
711
+ They read the drawing's structure tree as it is now (`getDrawing`), so they are called from handlers and effects,
712
+ not to render.
713
+
714
+ **Example**
715
+
716
+ ```tsx
717
+ import { useBounds } from '@react-three/drei'
718
+ import { getDrawing } from '@classcad/sdkjs'
719
+ import type { DrawingID } from '@classcad/sdkjs'
720
+ import { sketchUtils } from '@classcad/react-cad'
721
+
722
+ // inside drei's <Bounds>: a button of the app's that looks straight at the sketch being edited
723
+ function useFitSketch(drawingId: DrawingID) {
724
+ const bounds = useBounds()
725
+ return () => {
726
+ if (!sketchUtils.isSketchActive(drawingId)) return
727
+ const active = getDrawing(drawingId).plugin.active.feature
728
+ const sketchId = sketchUtils.getSketchId(drawingId, getDrawing(drawingId).plugin.refs[active!]?.objectId)
729
+ const fit = sketchUtils.getSketchFitInfo(drawingId, sketchId, 4)
730
+ if (fit) bounds.refresh(fit.globBox).moveTo(fit.position).lookAt({ target: fit.target, up: fit.up }).fit()
731
+ }
732
+ }
733
+ ```
734
+
735
+ ### sketchUtils.calculateTangent() {#sketchutilscalculatetangent}
736
+
737
+ ```ts
738
+ function calculateTangent(
739
+ drawingId,
740
+ curveId,
741
+ point
742
+ ): Vector3 | undefined;
743
+ ```
744
+
745
+ Calculates the tangent vector of a CC_Line / CC_Arc / CC_Circle at the specified point.
746
+
747
+ #### Parameters
748
+
749
+ | Parameter | Type | Description |
750
+ | :------ | :------ | :------ |
751
+ | `drawingId` | `DrawingID` | The drawing id. |
752
+ | `curveId` | `number` | Id of a CC_Line / CC_Arc / CC_Circle. |
753
+ | `point` | `Vector3` | Point at which the tangent touches a curve. |
754
+
755
+ #### Returns
756
+
757
+ `Vector3` \| `undefined`
758
+
759
+ Tangent vector value.
760
+
761
+ ***
762
+
763
+ ### sketchUtils.getArcInfo() {#sketchutilsgetarcinfo}
764
+
765
+ ```ts
766
+ function getArcInfo(
767
+ start,
768
+ end,
769
+ center,
770
+ clockwise
771
+ ): {
772
+ bulge: number;
773
+ center: Vector3;
774
+ endAngle: number;
775
+ mid: Vector3;
776
+ radius: number;
777
+ startAngle: number;
778
+ };
779
+ ```
780
+
781
+ Calculates arc midpoint, radius, startAngle, endAngle and bulge values.
782
+
783
+ #### Parameters
784
+
785
+ | Parameter | Type | Description |
786
+ | :------ | :------ | :------ |
787
+ | `start` | `Vector3` | Start point of an arc. |
788
+ | `end` | `Vector3` | End point of an arc. |
789
+ | `center` | `Vector3` | Center point of an arc. |
790
+ | `clockwise` | `boolean` | True if the direction from start to end is clockwise, false otherwise. |
791
+
792
+ #### Returns
793
+
794
+ An object with center, mid, radius, startAngle, endAngle and bulge values.
795
+
796
+ | Name | Type | Description |
797
+ | :------ | :------ | :------ |
798
+ | `bulge` | `number` | Its bulge: the tangent of a quarter of the angle it spans. |
799
+ | `center` | `Vector3` | The arc's center (a copy). |
800
+ | `endAngle` | `number` | The angle of its end, in radians, a turn on where needed to go the arc's way from the start. |
801
+ | `mid` | `Vector3` | The point halfway along the arc. |
802
+ | `radius` | `number` | Its radius: the mean of the start's and the end's distance from the center. |
803
+ | `startAngle` | `number` | The angle of its start, in radians. |
804
+
805
+ ***
806
+
807
+ ### sketchUtils.getArcPreviewValue() {#sketchutilsgetarcpreviewvalue}
808
+
809
+ ```ts
810
+ function getArcPreviewValue(
811
+ dir0,
812
+ dir1,
813
+ sector,
814
+ reflex
815
+ ): number;
816
+ ```
817
+
818
+ Calculates the angle between dir0 and dir1 or their negations depending on sector and reflex values.
819
+
820
+ #### Parameters
821
+
822
+ | Parameter | Type | Description |
823
+ | :------ | :------ | :------ |
824
+ | `dir0` | `Vector3` | The first direction. |
825
+ | `dir1` | `Vector3` | The second direction. |
826
+ | `sector` | `number` | The sector index (0-3). |
827
+ | `reflex` | `number` | A flag for changing angle coverage from the current sector to the opposite 3. |
828
+
829
+ #### Returns
830
+
831
+ `number`
832
+
833
+ The resulting angle between dir0 and dir1.
834
+
835
+ ***
836
+
837
+ ### sketchUtils.getArcSector() {#sketchutilsgetarcsector}
838
+
839
+ ```ts
840
+ function getArcSector(
841
+ dimPos,
842
+ dir0,
843
+ dir1,
844
+ center
845
+ ): 0 | 1 | 2 | 3;
846
+ ```
847
+
848
+ Finds the sector (indexed 0-3) to which the dimPos belongs to. Sectors are divided by dir0 and dir1 vectors and their negations.
849
+
850
+ #### Parameters
851
+
852
+ | Parameter | Type | Description |
853
+ | :------ | :------ | :------ |
854
+ | `dimPos` | `Vector3` | A point |
855
+ | `dir0` | `Vector3` | The first direction. |
856
+ | `dir1` | `Vector3` | The second direction. |
857
+ | `center` | `Vector3` | A center point of the arc. |
858
+
859
+ #### Returns
860
+
861
+ `0` \| `1` \| `2` \| `3`
862
+
863
+ A sector index (0-3) to which the dimPos belongs to.
864
+
865
+ ***
866
+
867
+ ### sketchUtils.getEntities() {#sketchutilsgetentities}
868
+
869
+ ```ts
870
+ function getEntities(drawingId, objectId): number[];
871
+ ```
872
+
873
+ Looks up for entities of a 2d constraint / sketch region.
874
+
875
+ #### Parameters
876
+
877
+ | Parameter | Type | Description |
878
+ | :------ | :------ | :------ |
879
+ | `drawingId` | `DrawingID` | The drawing id. |
880
+ | `objectId` | `number` | Id of a 2d constraint / sketch region. |
881
+
882
+ #### Returns
883
+
884
+ `number`[]
885
+
886
+ Ids of geometry entities linked to the specified 2d constraint / sketch region.
887
+
888
+ ***
889
+
890
+ ### sketchUtils.getObjCenterPoint() {#sketchutilsgetobjcenterpoint}
891
+
892
+ ```ts
893
+ function getObjCenterPoint(drawingId, geometryId): Vector3;
894
+ ```
895
+
896
+ Calculates an object's center point.
897
+
898
+ #### Parameters
899
+
900
+ | Parameter | Type | Description |
901
+ | :------ | :------ | :------ |
902
+ | `drawingId` | `DrawingID` | The drawing id. |
903
+ | `geometryId` | `number` | Id of a sketch geometry. |
904
+
905
+ #### Returns
906
+
907
+ `Vector3`
908
+
909
+ A center point of specified sketch geometry.
910
+
911
+ ***
912
+
913
+ ### sketchUtils.getSketchBounds() {#sketchutilsgetsketchbounds}
914
+
915
+ ```ts
916
+ function getSketchBounds(boundsMember): {
917
+ box: Box3;
918
+ center: Vector3;
919
+ radius: number;
920
+ };
921
+ ```
922
+
923
+ Looks up for sketch's bounds values.
924
+
925
+ #### Parameters
926
+
927
+ | Parameter | Type | Description |
928
+ | :------ | :------ | :------ |
929
+ | `boundsMember` | `ScgArrayMem` | The sketch.boundingBox member. |
930
+
931
+ #### Returns
932
+
933
+ An object containing the center, radius and box values.
934
+
935
+ | Name | Type | Description |
936
+ | :------ | :------ | :------ |
937
+ | `box` | `Box3` | The bounds, in the sketch's own coordinates. |
938
+ | `center` | `Vector3` | The center of the sketch's bounds. |
939
+ | `radius` | `number` | The radius of the sphere around them. |
940
+
941
+ ***
942
+
943
+ ### sketchUtils.getSketchFitInfo() {#sketchutilsgetsketchfitinfo}
944
+
945
+ ```ts
946
+ function getSketchFitInfo(
947
+ drawingId,
948
+ sketchId,
949
+ radiusMultiplier?
950
+ ):
951
+ | {
952
+ globBox: Box3;
953
+ position: Vector3;
954
+ target: Vector3;
955
+ up: Vector3;
956
+ }
957
+ | undefined;
958
+ ```
959
+
960
+ Calculates the global bounding box, camera position, camera target and camera up vector to fit the camera for the given sketch.
961
+
962
+ #### Parameters
963
+
964
+ | Parameter | Type | Default value | Description |
965
+ | :------ | :------ | :------ | :------ |
966
+ | `drawingId` | `DrawingID` | `undefined` | The drawing id. |
967
+ | `sketchId` | `number` | `undefined` | Id of the sketch. |
968
+ | `radiusMultiplier?` | `number` | `1` | A multiplier for the distance between camera and sketch. |
969
+
970
+ #### Returns
971
+
972
+ An object with globBox, position, target and up values.
973
+
974
+ ##### Type Literal
975
+
976
+ ```ts
977
+ {
978
+ globBox: Box3;
979
+ position: Vector3;
980
+ target: Vector3;
981
+ up: Vector3;
982
+ }
983
+ ```
984
+
985
+ | Name | Type | Description |
986
+ | :------ | :------ | :------ |
987
+ | `globBox` | `Box3` | The sketch's bounds in world coordinates. |
988
+ | `position` | `Vector3` | Where the camera goes: on the sketch plane's normal, over its middle. |
989
+ | `target` | `Vector3` | What the camera looks at: the middle of the sketch. |
990
+ | `up` | `Vector3` | The camera's up: the sketch's Y. |
991
+
992
+ ***
993
+
994
+ `undefined`
995
+
996
+ ***
997
+
998
+ ### sketchUtils.getSketchId() {#sketchutilsgetsketchid}
999
+
1000
+ ```ts
1001
+ function getSketchId(drawingId, objId): number;
1002
+ ```
1003
+
1004
+ Searches for the sketch which nests the specified object.
1005
+
1006
+ #### Parameters
1007
+
1008
+ | Parameter | Type | Description |
1009
+ | :------ | :------ | :------ |
1010
+ | `drawingId` | `DrawingID` | The drawing id. |
1011
+ | `objId` | `number` \| `undefined` | Id of an object which (supposedly) is nested within some sketch. |
1012
+
1013
+ #### Returns
1014
+
1015
+ `number`
1016
+
1017
+ Id of the sketch which nests the specified object, or -1 if it wasn't found.
1018
+
1019
+ ***
1020
+
1021
+ ### sketchUtils.getSketchNormalViewInfo() {#sketchutilsgetsketchnormalviewinfo}
1022
+
1023
+ ```ts
1024
+ function getSketchNormalViewInfo(
1025
+ drawingId,
1026
+ sketchId,
1027
+ targetPos,
1028
+ distance
1029
+ ):
1030
+ | {
1031
+ globBox: Box3;
1032
+ position: Vector3;
1033
+ target: Vector3;
1034
+ up: Vector3;
1035
+ }
1036
+ | undefined;
1037
+ ```
1038
+
1039
+ Calculates the global bounding box, camera position, camera target and camera up vector for the given sketch to target some point with camera oriented orthogonally to it.
1040
+
1041
+ #### Parameters
1042
+
1043
+ | Parameter | Type | Description |
1044
+ | :------ | :------ | :------ |
1045
+ | `drawingId` | `DrawingID` | The drawing id. |
1046
+ | `sketchId` | `number` | Id of the sketch. |
1047
+ | `targetPos` | `Vector3` | A point near the sketch plane to use as the camera target. |
1048
+ | `distance` | `number` | The distance value to set between camera and sketch. |
1049
+
1050
+ #### Returns
1051
+
1052
+ An object with globBox, position, target and up values.
1053
+
1054
+ ##### Type Literal
1055
+
1056
+ ```ts
1057
+ {
1058
+ globBox: Box3;
1059
+ position: Vector3;
1060
+ target: Vector3;
1061
+ up: Vector3;
1062
+ }
1063
+ ```
1064
+
1065
+ | Name | Type | Description |
1066
+ | :------ | :------ | :------ |
1067
+ | `globBox` | `Box3` | The sketch's bounds in world coordinates. |
1068
+ | `position` | `Vector3` | Where the camera goes: `distance` along the sketch plane's normal from the target. |
1069
+ | `target` | `Vector3` | What the camera looks at: `targetPos` projected onto the sketch's plane. |
1070
+ | `up` | `Vector3` | The camera's up: the sketch's Y. |
1071
+
1072
+ ***
1073
+
1074
+ `undefined`
1075
+
1076
+ ***
1077
+
1078
+ ### sketchUtils.getSketchPriority() {#sketchutilsgetsketchpriority}
1079
+
1080
+ ```ts
1081
+ function getSketchPriority(arg): -1 | 1 | 2 | 3;
1082
+ ```
1083
+
1084
+ Defines a numeric priority of sketch objects and regions, which may be used for sorting them or as a polygon offset for rendering.
1085
+
1086
+ #### Parameters
1087
+
1088
+ | Parameter | Type | Description |
1089
+ | :------ | :------ | :------ |
1090
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1091
+
1092
+ #### Returns
1093
+
1094
+ `-1` \| `1` \| `2` \| `3`
1095
+
1096
+ A number value (1-5) which represents the sketch object's priority, or -1 if arg is not a sketch object.
1097
+
1098
+ ***
1099
+
1100
+ ### sketchUtils.is2DConstraint() {#sketchutilsis2dconstraint}
1101
+
1102
+ ```ts
1103
+ function is2DConstraint(arg): boolean;
1104
+ ```
1105
+
1106
+ Checks if the object represents a 2d constraint.
1107
+
1108
+ #### Parameters
1109
+
1110
+ | Parameter | Type | Description |
1111
+ | :------ | :------ | :------ |
1112
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1113
+
1114
+ #### Returns
1115
+
1116
+ `boolean`
1117
+
1118
+ True if the object represents a 2d constraint, false otherwise.
1119
+
1120
+ ***
1121
+
1122
+ ### sketchUtils.isConstruction() {#sketchutilsisconstruction}
1123
+
1124
+ ```ts
1125
+ function isConstruction(arg): boolean;
1126
+ ```
1127
+
1128
+ Checks if the object is a construction geometry.
1129
+
1130
+ #### Parameters
1131
+
1132
+ | Parameter | Type | Description |
1133
+ | :------ | :------ | :------ |
1134
+ | `arg` | `ScgObject` | A structure object or CCClass of a structure object. |
1135
+
1136
+ #### Returns
1137
+
1138
+ `boolean`
1139
+
1140
+ True if the object is a construction geometry, false otherwise.
1141
+
1142
+ ***
1143
+
1144
+ ### sketchUtils.isSketchActive() {#sketchutilsissketchactive}
1145
+
1146
+ ```ts
1147
+ function isSketchActive(drawingId): boolean;
1148
+ ```
1149
+
1150
+ Checks if the drawing's active feature is a sketch (`CC_Sketch`): [useIsSketchActive](../hooks.md#useissketchactive), outside of a component.
1151
+
1152
+ #### Parameters
1153
+
1154
+ | Parameter | Type | Description |
1155
+ | :------ | :------ | :------ |
1156
+ | `drawingId` | `DrawingID` | The drawing id. |
1157
+
1158
+ #### Returns
1159
+
1160
+ `boolean`
1161
+
1162
+ True if CC_Sketch is active, false otherwise.
1163
+
1164
+ ***
1165
+
1166
+ ### sketchUtils.isSketchCurve() {#sketchutilsissketchcurve}
1167
+
1168
+ ```ts
1169
+ function isSketchCurve(arg): boolean;
1170
+ ```
1171
+
1172
+ Checks if the object represents a sketch curve.
1173
+
1174
+ #### Parameters
1175
+
1176
+ | Parameter | Type | Description |
1177
+ | :------ | :------ | :------ |
1178
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1179
+
1180
+ #### Returns
1181
+
1182
+ `boolean`
1183
+
1184
+ True if the object represents a sketch curve, false otherwise.
1185
+
1186
+ ***
1187
+
1188
+ ### sketchUtils.isSketchGeometry() {#sketchutilsissketchgeometry}
1189
+
1190
+ ```ts
1191
+ function isSketchGeometry(arg): boolean;
1192
+ ```
1193
+
1194
+ Checks if the object represents a sketch geometry.
1195
+
1196
+ #### Parameters
1197
+
1198
+ | Parameter | Type | Description |
1199
+ | :------ | :------ | :------ |
1200
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1201
+
1202
+ #### Returns
1203
+
1204
+ `boolean`
1205
+
1206
+ True if the object represents a sketch geometry, false otherwise.
1207
+
1208
+ ***
1209
+
1210
+ ### sketchUtils.isSketchObj() {#sketchutilsissketchobj}
1211
+
1212
+ ```ts
1213
+ function isSketchObj(arg): boolean;
1214
+ ```
1215
+
1216
+ Checks if the object represents a sketch geometry or 2d constraint or a sketch itself.
1217
+
1218
+ #### Parameters
1219
+
1220
+ | Parameter | Type | Description |
1221
+ | :------ | :------ | :------ |
1222
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1223
+
1224
+ #### Returns
1225
+
1226
+ `boolean`
1227
+
1228
+ True if the object represents a sketch or a sketch geometry or a 2d constraint, false otherwise.
1229
+
1230
+ ***
1231
+
1232
+ ### sketchUtils.isSketchRegion() {#sketchutilsissketchregion}
1233
+
1234
+ ```ts
1235
+ function isSketchRegion(arg): boolean;
1236
+ ```
1237
+
1238
+ Checks if the object represents a sketch region.
1239
+
1240
+ #### Parameters
1241
+
1242
+ | Parameter | Type | Description |
1243
+ | :------ | :------ | :------ |
1244
+ | `arg` | `ScgObject` \| `ScgClassType` | A structure object or CCClass of a structure object. |
1245
+
1246
+ #### Returns
1247
+
1248
+ `boolean`
1249
+
1250
+ True if the object represents a sketch region, false otherwise.
1251
+
1252
+ ***
1253
+
1254
+ ### sketchUtils.projectPointOnGeometry() {#sketchutilsprojectpointongeometry}
1255
+
1256
+ ```ts
1257
+ function projectPointOnGeometry(
1258
+ drawingId,
1259
+ geometryId,
1260
+ point
1261
+ ): Vector3;
1262
+ ```
1263
+
1264
+ Projects a point onto the specified sketch geometry.
1265
+
1266
+ #### Parameters
1267
+
1268
+ | Parameter | Type | Description |
1269
+ | :------ | :------ | :------ |
1270
+ | `drawingId` | `DrawingID` | The drawing id. |
1271
+ | `geometryId` | `number` | Id of a sketch geometry. |
1272
+ | `point` | `Vector3` | A point to be projected. |
1273
+
1274
+ #### Returns
1275
+
1276
+ `Vector3`
1277
+
1278
+ A projected point.
1279
+
1280
+ ***
1281
+
1282
+ ### sketchUtils.rollUpPoints() {#sketchutilsrolluppoints}
1283
+
1284
+ ```ts
1285
+ function rollUpPoints(
1286
+ drawingId,
1287
+ id1,
1288
+ id2
1289
+ ): number[];
1290
+ ```
1291
+
1292
+ Takes ids of 2 CC_Points and if they belong to the same line, returns the id of that line; otherwise, returns ids of these points.
1293
+
1294
+ #### Parameters
1295
+
1296
+ | Parameter | Type | Description |
1297
+ | :------ | :------ | :------ |
1298
+ | `drawingId` | `DrawingID` | The drawing id. |
1299
+ | `id1` | `number` | Id of the first CC_Point. |
1300
+ | `id2` | `number` | Id of the seconds CC_Point. |
1301
+
1302
+ #### Returns
1303
+
1304
+ `number`[]
1305
+
1306
+ An array with a single id of the CC_Line if both points belong to the same one, or an array [id1, id2] otherwise.