First of all, thank you for taking the time to put this forum up.
Here's what I use JSCAD for,
Coder since 1978, cardboard crafter since 2007, digital cardboard crafter and JSCAD user since 2014.
@jamesnewton Indeed it is not that critical, it won't be bad to have already answered questions on the previous forum asked again here, so up to date answers could be provided. By the way those who have jscad knowledge/experience to share can make a post to show what they do, put some code.
Hello, I'm deploying crafting resources on design section of my github account, and to do so I share several furniture designs, I have about 10 now, but I have lots more to add. For each of them I share the 3d model and links to open jscad scripts with them. I currently have almost the same using v1 and I wrote an html/js page to create jscad code with the good script and the good 3d model. I don't know how to do that with v2, so I'm trying something else.
( can be seen here : https://github.com/gilboonet/designs/blob/master/MEUBLES/readme.md )
For each design there's :
I would like to replace the link to online 3d viewer by a link to a jscad script where it would be possible to rescale it, and show its dimensions, but the only solution that I have in mind is to write a script for that, and duplicate it for each 3d model. It's already what I am doing for the skeleton script.
Do you think that for such case, I mean choose a model then a script to apply on it, there could be a mechanism. Locally I already use dynamic require from a text parameter and it works well, but on remote script I didn't manage to make it work. Maybe is there a way to run a script from a remote folder ? or a way to require an url ?
Hello, I'm using JSCAD for years now to help me build cardboard objects, statues and furniture. I decided at the beginning of this year to build a website offering users to do the same. My crafts need essentially 2d patterns to cut, fold and glue. I used last V1 version that I embedded in my website, and replace viewer-minimal.html with some custom html allowing the user to first choose a 3d model (from a .jscad script, a .stl file, or a .obj file), then one of my crafting scripts that runs on the chosen 3d model. User configures the craft as needed, then run its 2d mode that renders 2d data. Last, user click on "Créer PDF" (create PDF) that uses the 2d data and make a .PDF file. It works fine and not only on pc (I use Ubuntu/Firefox) but also on tablet (Android).
You can use it here : https://gilboonet.github.io/OpenJSCAD.org/packages/web/scripts.html
There are some example models on "(Charger volume)".
"Depliage" script takes lot of time to render and it can take advantage of colored zones (materials) from a .obj file.
code is here (but beware I'm not an IT pro) https://github.com/gilboonet/gilboonet.github.io/tree/master/OpenJSCAD.org/packages/web see scripts.html and dist/scripts.js )
Hello, I cannot help with react as I don't use it. Did you take a look at viewer-minimal.html (https://github.com/jscad/OpenJSCAD.org/blob/master/packages/web/viewer-minimal.html) ? It was my starting point to integrate jscad into web pages.
@platypii Thank you for this investigation. I remember that I tried to get JSCAD to union those groups but then it loses colors. I use Wings 3d to colorize my models, and it does not split them into separate objects (on my screenshot I have only one geometry), only materials are separated into groups.
I splitted the model into 3 geometries and then exported it to .obj and the difference is that it contains 3 lines starting with "o " that defines start of an object. Maybe for the moment JSCAD translate lines starting with "g " like "o ".
I'm not sure that a jscad project can be fired from an URL. It would be great because for the moment lots of users don't use the projects that I share because it seems too complex for them to 1°) upload it (as a .zip) 2°) unzip it into a directory 3°) open JSCAD, click "load jscad project" and choose this directory 4°) And put the files they want to use into the directory then reload the project. So I mostly only share .jscad directly but for my kind of designs that relay on 3d files, it's too complex for non dev users.
@platypii for sure, you can try this one that has exactly the same problem https://openjscad.xyz/#https://raw.githubusercontent.com/gilboonet/gilboonet.github.io/master/creations/source/st_s001.obj and if you need more examples, I started creating links to models on this page : https://gilboonet.github.io/creations/index.html (the models links are numbers followed by a triangle at the beginning of each item)
Direct link to the obj file : https://github.com/gilboonet/gilboonet.github.io/blob/master/creations/source/st_s001.obj
@z3dev JSCAD exported obj with holes breaks my automatic unfolder, I could add code to make it handle holes (edges without neighbor) as I do for the previous version. The aim of my catalog is to allow users to use the models I already unfold for customized needs (typically change size, crop thtm, and as soon as possible decimate them), and I was willing to to those customization with JSCAD. OBJ is the format I use because it can store color information for each triangle. Apparently for the moment this color information is lost when you import a colored OBJ and export it to OBJ.
Hello, I'm adding a catalog to my website and I would like to use jscad to show 3d models and was thinking that users could simply export the model to .OBJ to download it, but the it seems that jscad adds faces and holes to the exported model.
on the middle is the original model with 400 triangles and no holes
on the left is the model that JSCAD exported with 416 triangles and 16 holes.
I will simply only use JSCAD to view the model and add a link for users to download the obj file, but as I'm planning to use JSCAD to dynamically decimate a 3d model, I will certainly export to STL.
Hello, years ago I made an editor that used pre V1 JSCAD to help me build structures and I'm wondering whether it is now possible to do the same using V2 JSCAD.
This editor is a little like a polyhedron editor except that there's no control on Z axis. The structure consist of a net of shelves using a common array of vertices, so that when a vertice is moved, it also moves all shelves that are using it.
The editor is made of a JSCAD script that uses an hidden parameter and a js/html UI where the vertices and the shelves are created and moved, synced to the hidden JSCAD paramter. Rendering is done by clicking "Update" on JSCAD UI. I also added load/save of data (vertices and shelves).
Do you have an entry point I can use to do the same using V2 JSCAD ?
At least I could try to make a simpler JSCAD script that loads a data file, but how can I achieve this ? Using require ? or JSON ?
The editor is here : http://gilboo.carton.free.fr/OJSC5/edit_ner2.html
@antoine-guillaume Hello, you can do whatever you want into getParameterDefinitions() but due to code cinematic you won't be able to use parameters value for that. For scripts that use variable number of parameters, I use text parameters and enter multiple values on them using separators, semi-comma between sets of parameters and comma between values (when some are optional). And at runtime I parse the text parameters (using split()) to get needed data.