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 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.
Hello, it can be done like that, put a "#" after openJSCAD.org then the url of your script.
@BarbourSmith I saw your post but didn't reply as I wasn't sure it was about. I already tried on V2 the function that splits a solid into pieces as it is something that i use a lot : https://jscad.xyz/#https://raw.githubusercontent.com/gilboonet/gilboonet.github.io/master/demos/gig2i.js The function is scission3d() and the source is here : https://github.com/gilboonet/gilboonet.github.io/blob/master/demos/gig2i.js
@z3dev I could easily adapt to any solution allowing to feed a list parameter with files, it will be far a better UI practice than my current one that requires the user to type the file name. Or maybe the ability for a text parameter to receive a file from a drag-drop operation.
I have a script that makes a volume from two svg files that are chosen from text parameters. Then a require is made from those parameters. Won't it be possible to have a list parameter that can be feeded from file names (naturally from project folder) filtered by a mask (like *.svg or profil??.svg ) ?
@z3dev the svg is here : https://github.com/gilboonet/gilboonet.github.io/blob/master/demos/demi_l.svg
What I'm trying to do is a composite volume made of half a revolution of extrudeRotate then extrudeLinear with the same shape. I was able to have both extrusion method return a volume, but they don't coincide.
colorize function accepts an array as parameter containing RGBA values, each from 0 to 1, A is for alpha transparency.
taken from the source :
I tried to dig further this design and decided to only keep half revolution of the extrudeRotate and add an extrudeLinear to its flat end. Seems that extrudeRotate and extrudeLinear with the same input result in volumes of different scales. And mirrorX on this input gives a polygon that must be reversed to be correct. At first I tried to use the polygons from the extrudeRotate to do the extrudeLinear, but seems that it doesn't work with 3d polygons, I will try to 2d it as I have a function for that. Unfortunately, I don't see how to find the correct scale to align rotate and linear parts of this design.
This is very nice to be able to do such design even if for the moment it is not complete.
I tried to make a curved volume using extrudeRotate with a bezier curve (svg file) as input, but it didn't work (third meshlab window). So I replace the bezier by lots of lines, but it made the same (first meshlab window). By reversing points order when making the polygon (shape.points.reverse()), it was ok, but this operation result in an error with the bezier svg points. With bezier polygons, there is maybe a smarter way to reverse points ? maybe only reverse physical points and keep bezier control points order, but how ?
I converted some of V1 examples to V2 and when I run them both in V1 and V2, their performance looks the same. I'm on Ubuntu with Firefox both on a very old tabletop pc (with a 2011 Radeon) and on a recent laptop (with Ryzen 3).
@z3dev An option to show/hide slider value would be great. Long ago I made some tweaks to parameters that looked like that, but now jscad architecture is too complex for me to make such changes. On the bottom of the screenshot you can see file browser to import/export parameters that I also added and was of great help to make complex models.