{
- entry.visible = false;
+ obj3d.visible = false;
sc.render()
forceUpdate()
}}
@@ -118,7 +122,7 @@ const TreeEntry = ({ entId }) => {
:
{
- entry.visible = true;
+ obj3d.visible = true;
sc.render()
forceUpdate()
}}
@@ -156,6 +160,28 @@ const TreeEntry = ({ entId }) => {
}
-const DesignLeaf = () => {
+const subtract = () => {
+ // //Create a bsp tree from each of the meshes
+ console.log(sc.selected.length !=2 || !sc.selected.every(e=>e.name && e.name[0]=='m'),"wtf")
+ if (sc.selected.length !=2 || !sc.selected.every(e=>e.name && e.name[0]=='m')) return
+ console.log('here')
+ const [m1, m2] = sc.selected
+
+ let bspA = BoolOp.fromMesh( m1 )
+ let bspB = BoolOp.fromMesh( m2 )
+ m1.visible = false
+ m2.visible = false
+
+ // // Subtract one bsp from the other via .subtract... other supported modes are .union and .intersect
+
+ let bspResult = bspA.subtract(bspB)
+
+ // //Get the resulting mesh from the result bsp, and assign meshA.material to the resulting mesh
+
+ let meshResult = BoolOp.toMesh( bspResult, m1.matrix, m1.material )
+
+ sc.obj3d.add(meshResult)
+ sc.render()
+
+}
-}
\ No newline at end of file
diff --git a/src/extrude.js b/src/extrude.js
index 4c6b045..24c84e9 100644
--- a/src/extrude.js
+++ b/src/extrude.js
@@ -1,5 +1,5 @@
import * as THREE from 'three/src/Three';
-import { color, ptObj } from './utils/static'
+import { color, ptObj } from './utils/shared'
export function extrude(sketch) {
let constraints = sketch.constraints;
diff --git a/src/icons.jsx b/src/icons.jsx
index 882f6ce..a4bdcf9 100644
--- a/src/icons.jsx
+++ b/src/icons.jsx
@@ -23,6 +23,67 @@ function Arc(props) {
);
}
+function Dimension(props) {
+ return (
+
+ );
+}
+
function Intersect(props) {
return (