@gilboonet it is hard to say why jscad does not work on old tablet, could be many different reasons. It should, but who knows what error happens that it fails. We try to keep it compatible.
using an exported STL into a script
-
Hello, this week I made V2 version of simple furniture parametric designs. It's very simple scripts and they work fine (they are here : https://github.com/gilboonet/gilboonet.github.io/blob/master/outils/README.md)
My process then is to save the design as 3d model file, then use this file with another of my scripts to render it as a 2s skeleton that I cut. Sadly, if I try to use the exported stl file, my script has problems depending of where I want to slice. I found a workaround that is importing the stl file into Wings 3d then export it as obj and use that obj, then my script work fine. I don't see difference between the stl and obj models, so it is maybe the way they are imported to jscad (I use dynamic require). Another solution I will maybe try is to render the model using its parameters directly into the slicing script, but it's not very handy.
What is the 3d format you would recommend ?
-
this will soon be fixed https://github.com/jscad/OpenJSCAD.org/issues/935
-
@hrgdavor It's a tablet that I used with my jscad scripts for a long time...
-
@hrgdavor I think Firefox 68.11.0 is the last one that can be installed in this tablet, I will try to update/install other browsers.
-
@z3dev this to do with OES_element_index_uint I have added as a step to move fwd to simplify webgl for large geometries where indices easily go over 65536.
this check is not required right now as new code for converting to webgl buffers is not yet done.
@gilboonet could you upgrade the browser u are using, or install a different one on that tablet ?
-
@gilboonet I have a few old tablets as well, and will test this further. I think we adjusted the code to detect this properly, but may have missed something.
-
@z3dev I tried to see what ES6 javascript engine it has, only saw the firefox version that is 68.11.0. It displays an error about webgl
But I'm using it for years with webgl appsBut it is not important, it's just that is was very handy to use jscad on it and the screen is bigger than a smartphone screen.
-
@gilboonet said in using an exported STL into a script:
One advantage that Cascade Studio has over jscad is that it works even on old android tablets that used to be able to run jscad but doesn't anymore.
I would guess that those old tablets have a non-ES6 compatible JavaScript engine. The V2 JSCAD code is taking advantage of some of the newer JavaScript features, such as spread operator, etc.
-
@gilboonet it is hard to say why jscad does not work on old tablet, could be many different reasons. It should, but who knows what error happens that it fails. We try to keep it compatible.
-
@hrgdavor The geometries are good. It's something I'm trying to do with jscad for more than 5 years now and for years, before v2 and last build of v1, it wasn't. I already tried to start from union of difference of rectangles and then extrude, but the STL i get is the same as the one I get from union of difference of cuboids. For me, the advantage that jscad has over Cascade Studio is that it renders 2d, I mostly only use web versions, so the size of a build doesn't matter. One advantage that Cascade Studio has over jscad is that it works even on old android tablets that used to be able to run jscad but doesn't anymore.
-
@gilboonet for the examples you have here on the screenshots you may get better results by doing booleans in 2d and then extrude.
The boolean operations in jscad are based on polygons of the geometries and it is a generic algorithm, it is possible from there that you get resulting geometry that looks good, but creates difficulties when slicing.
You of course want to use the tool that gives you good results right now, but if you have time to investigate this further it would be appreciated.
It is interesting to me to see if this is something that could be fixed, or at least if there could be a workaround.
one advantage jscad has over OpenCascade is that regular build of WASM for OCCT is 12MB.
-
@hrgdavor what is breaking my flow using jscad is that it produces 3d models that seems to be hard to slice but only from some coordinates. It is maybe due to the way it splits polygons from its center.
-
is this due to different output genrated for the same 3d geometry ?
cascade studio uses OCCT that could be preserving surfaces closer to what u expect.
it should be possible to use OCCT inside jscad in the future, but you should use tool that gives you better results right now.
If you find out what is breaking your flow while using jscad, let us know
-
-
@gilboonet np, keep the cool tools comming I will let you know as soon as I have a simplified way to integrate with jscad.
-
@hrgdavor Thank you for your suggestion. For the moment I'm simply using another tool to run those scripts, Cascade Studio, that produces an STL output that can be used without errors with my scripts, it can also save to OBJ that is handy for my unfolder.
-
@gilboonet you could try export JSON. The json export will give you exact copy of the objects you return from the main method. Then you can continue using the objects in your other script the same as it would be inside the main