Wings 3D Development Forum
OpenJSCAD plugin - exporter - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6)
+--- Thread: OpenJSCAD plugin - exporter (/showthread.php?tid=2865)

Pages: 1 2


RE: OpenJSCAD plugin - exporter - gilboonet - 12-15-2019

with more than one object it also works, as you suggested before, one function for each object, volume1(), volume2() and so on, and in the main return an array [volume1().csg, volume2().csg]. But people must be aware that in order to keep track of data it is better to have a little more complex main function like that :

function main(){
let V1 = volume1(), V2 = volume2();

// it is now possible to use data like V1.groups

return [V1.csg, V2.csg];
}
[Image: Capture-d-cran-de-2019-12-15-11-47-28.png]


RE: OpenJSCAD plugin - exporter - micheus - 12-17-2019

New version is almost ready.

I added the "One group per material" option to the exporter dialog. The first version was splitting the object by default and it seems to not be the right thing to do.

This option will not attend your usage of the exported file, I know, but will keep the standard with the other exporters/apps.

Each object is created in a function named with its name and in case of the previous option be checked, then it will include the material name too.
That will allow uses to create primitives on Wings3D and use it on their scripts to create multiples copies of it.

So, I'm adding the option "Export faces group" to export the groups number (based on material), but without split an object in multiple ones and also the option "Creation function returns" ("GSG Object" or "Properties").

The option "Build the main() statement" will allow the file be part of a library and be used in includes.

Both options should give you what you have been using in your script to create those papercraft. Smile


What I still need to know:
1) Is it necessary to sort the polygons based on groups? Since there is in groups a reference for each face it looks like it doesn't matter;
Is that right?

2) To keep the names more consistent with the JSCAD terminology (and not Wings3D) I would like to name the returned fields like this:
return {points:points,polygons:polygons,groups:groups,csgpolys:csgpolys,csg:csg};
Is that a problem?
Can you adjust your script to fit on it?



RE: OpenJSCAD plugin - exporter - gilboonet - 12-17-2019

1. You're right, there's no need to sort polygons on group.
2. There's no problem with the naming convention you choose, I will adapt my script.

I will test your plugin as soon as it will be available.

I'm not making papercraft, but cardboard structures, those statues are only clothes, skinning, but this techniques also allow to build furniture, a interlocked skeleton and then the clothe, both computed by jscad scripts.


RE: OpenJSCAD plugin - exporter - micheus - 12-18-2019

(12-17-2019, 10:01 PM)gilboonet Wrote: I will test your plugin as soon as it will be available.
You can get it here: wpc_jscad.beam (after download, use the menu File->Install plug-in or Path to install/update it).

For your use you will need to create the materials and enable the "Export face's groups" option.

Quote:I'm not making papercraft, but cardboard structures, ...
Sorry for my mistake. My poor English made me believe it would be the same thing. Smile


RE: OpenJSCAD plugin - exporter - gilboonet - 12-18-2019

I've just tested the new version of the plugin and it works fine...
[Image: Capture-d-cran-de-2019-12-18-15-34-24.png]

I will try to use it on my workflow ASAP. Thanks a lot for that.


RE: OpenJSCAD plugin - exporter - micheus - 12-18-2019

Thanks for the feedback. Let me know if it needs some adjustments.


RE: OpenJSCAD plugin - exporter - micheus - 12-18-2019

I just noticed a minimal mistake. Wrongly fixed the situation which the object name has an space (" ") character and that causes OpenJSCAD to display an error message.

I just fixed and updated the link above. Smile


RE: OpenJSCAD plugin - exporter - micheus - 02-25-2020

It was added the Tesselation to the dialog exporter - as already used for other exporters.
You can get the update here: wpc_jscad.beam (after download, use the menu File->Install plug-in or Path to install/update it).