This is not an issue but something I think is really good, interesting and to build on.
I used csg.js and ThreeCSG.js to use CSG to create my own frame.
This is what I used to create my frame:
(Take a normal box and take away 3 boxes in the 3 axes that are a bit smaller in two dimensions)
var fbox = new ThreeBSP( new THREE.Mesh( new THREE.BoxGeometry( 1, 1, 1 )));
var cutframe1 =new ThreeBSP(new THREE.Mesh(new THREE.BoxGeometry(1, 0.8, 0.8)));
var cutframe2 =new ThreeBSP(new THREE.Mesh(new THREE.BoxGeometry(0.8,1 , 0.8)));
var cutframe3 =new ThreeBSP(new THREE.Mesh(new THREE.BoxGeometry(0.8, 0.8, 1)));
var csg_result = fbox.subtract(cutframe1).subtract(cutframe2).subtract(cutframe3);
Geometry.CSG = csg_result.toGeometry();
I also added a primitive called csg so I can use it from the script.
Now for the really positive part of using a CSG generated object:
Times using regular box:
objects: 271
render time: 24421ms (24s)
times using CSG frame:
objects: 271
render time: 24478ms (24s)
time using Structure synth frame (12 boxes to make a frame - see script below)
objects: 3241
render time: 286136ms (about 5 minutes)
This is - I think - brilliant !!!!!
A object created using CSG seems to add nearly no time to the rendering !!!
That means offering CSG elements (or letting the user generate their own ones) makes it possible to render structures containing more "complex" primitives without extending render times.
This is not an issue but something I think is really good, interesting and to build on.
I used csg.js and ThreeCSG.js to use CSG to create my own frame.
This is what I used to create my frame: (Take a normal box and take away 3 boxes in the 3 axes that are a bit smaller in two dimensions)
I also added a primitive called csg so I can use it from the script.
Now for the really positive part of using a CSG generated object:
Times using regular box: objects: 271 render time: 24421ms (24s)
times using CSG frame: objects: 271 render time: 24478ms (24s)
time using Structure synth frame (12 boxes to make a frame - see script below) objects: 3241 render time: 286136ms (about 5 minutes)
This is - I think - brilliant !!!!! A object created using CSG seems to add nearly no time to the rendering !!! That means offering CSG elements (or letting the user generate their own ones) makes it possible to render structures containing more "complex" primitives without extending render times.
I LIKE THAT A LOT!!!!
script used to test:
set maxobjects 4000
6 * {rz 60 } tower
//tower rule tower md 16 > end{ {s 5}csg //frame {y 4.5 rx 10 s 0.9 } tower }
rule end md 28{ {s 5}csg //frame {y 4.5 rx -2 s 1 } end }
// strucsynth frame rule frame{ twotri {z 4.5 x 4.5 ry 180}twotri }
rule twotri{ tri {y 4.5 x 4.5 rz -90 rx 90}tri } rule tri{ {z 2.25 s 0.5 0.5 5}box {x 2.25 s 5 0.5 0.5}box {y 2.25 s 0.5 5 0.5}box }
// csg frame {s 1}csg