tmpvar / livecad

live coding of 3d surfaces and objects
livecad.wtf
53 stars 2 forks source link

deploy this to a server and see how fast it breaks #41

Closed tmpvar closed 10 years ago

tmpvar commented 10 years ago

With the memory pressure this is going to need a pretty beefy machine to handle more than one client. net-oce is basically ready to start doing TCP, so maybe a more complex deployment scheme with provisioning is in store

tmpvar commented 10 years ago

deployed to http://livecad.wtf (wow that's fun!) - let's see if anyone uses it!

tmpvar commented 10 years ago

and the winner is :racehorse: @RH2

with the code:

var distanceBetweenHoles = 31;
var centerCircleDiameter = 22;
var dimension = 0; // width and height
var materialWidth = 3;

// compute hole pattern
var triLeg = distanceBetweenHoles/2;
var l = Math.sqrt(triLeg*triLeg*2);

var b = box(dimension, materialWidth, dimension);
b = b.cut(cylinder(centerCircleDiameter/2, materialWidth));

var TAU = Math.PI*2;
var a45 = Math.PI/4;
var a90 = Math.PI/2

for (var i=1; i<=4; i++) {
  var c = cylinder(1.5, materialWidth).translate(
    l * Math.sin(i * a90 + a45),
    0,
    l * Math.cos(i * a90 + a45)
  );

  b = b.cut(c)
}

display(b)
tmpvar commented 10 years ago

botched the ref, but solids/net-oce@30b21a0e7a31eb8d14035c63954bdd175af3389a fixes this issue

tmpvar commented 10 years ago

derp, changing dimension = 20 dies due to terminate called after throwing an instance of 'Standard_ConstructionError'

probably need a try in op_cut

tmpvar commented 10 years ago

after adding try this has become pretty bombproof (hasn't taken down the node server since)