@Nick-Taylor this script looks incomplete, it is better to share a full script.
also if you have discord we have a channel there https://discord.gg/6PB7qZ4HC7
@Nick-Taylor this script looks incomplete, it is better to share a full script.
also if you have discord we have a channel there https://discord.gg/6PB7qZ4HC7
@hpb-htw I am happy more people are using jscad, but I have to schose my battles carefuly (so many things I would like todo in jscad, and so little time).
I am not able to lead the effort, but I will be here to help troubleshooting while you explore options how to use import with jscad.
There is one project that is doing it this way, and it uses sourcemaps. This could help you get stared: https://github.com/receter/jscad-playground/blob/main/index.html
Looking forward to see what you find and what you make, as there are likely others interested in this approach.
I am a bit confused, as initial description says model, but in the conversation here I am seing that you may want to actually execute a jscad script (to generate a model).
If you have STL files or some other format supported by jscad/io regl renderer is really a good choice as it is very light, and is just fine for displaying the model.
regl is still great if you want to execute a jscad script, but thigs get bit complicated there. Demo if I remember correctly executes model code directly on main thread, adn is you make sth complex that will need x number of seconds to generate, it would freeze the UI and confuse users.
If you will have more complex scripts, you will want to use a worker, and then thing get complicated. Especially if you want scripts that are split in multiple imports.
give us some more info on your use case, so we can suggest a good direction.
@DavidLyon66 this is just a desktop version of the jscad prototype: jscad.app.
openjscad.xyz stared implementing a desktop version, but was abandoned.
Although I can easily use jscad.app or openjscad.xyz in the browser there are benefits of having a desktop version (dedicated button in taskbar).
It could also be just personal preference to have desktop app that reliably works offline (PWA can be great but could break if cache is cleared while offline).
This is more of an attempt to reach more users, as some users consider not having a desktop app a deal-breaker.
For those interested in desktop app.
Here is initial draft version built with neutralino
https://3d.hrg.hr/jscad/desktop/draft1/
the desktop app is just wrapped jscad.app there is currently no specific customizations in it to enhance desktop experience.
it should work well if your OS web view is chrome (I did not implement FS access through neuralino yet)
to run it, download both: executable for your OS, and resources.neu, put them in the sam dir and run
Feedback for different OS is welcome, I only have windows available to test currently.
@Zachary-Keim good to hear. Guess it was a temporary issue
@Zachary-Keim
I clicked a bit but all links I tried except TOS worked ok
TOS links are broken.
what Other links did you find not working ?
@DavidLyon66 that is something I really want to imeplement, but I need to ask @z3dev to confirm this is not something in scope of jscad itself ... at least for now. I would need to experiment with it in jscadui.
I have made some progress there that will be usable for jscad, but it takes years with time am able to put aside for it.
making an extension that goes beyond exporting main method would allow to keep the current principle for jscad, and that principle serves well many users and many use cases.
I would go about it by requiring an interactive script like you would like to create to export a different method, for example: export function interactive(){...}
. There we could experiment with script doing more that just generating models without braking existing scripts and without confusing users that do not need such interactivity.
@DavidLyon66 said in Click to item for Callback/Event functionality:
I would have thought that a callback with an index for the item on selection might not have been that hard.
Said like that it is not too hard but it opens a pandora box and a can of worms.
Other contributors might disagree with me here, but I think this is something a separate project should do by using jscad.
@DavidLyon66 said in Click to item for Callback/Event functionality:
be able to in code be able to do modifications to that selected object.
in my opinion, this sentence alone makes it much more complicated than blender or ultimaker cura.
If someone would implement what you are suggesting in jscad I would very happy and impressed at the same time.
I am one of few developers that are still active on the project (although little by little, and much less I would like). Even if were to work on this full time my guess is it would take me at least a year, and even then I am not sure to what extent it would match your expectations (or at least what I imagine your expectations are here).
btw, Blender has much more people smarter than me working there full time.
TLDR;
This looks huge to me and I would not dare to even start it, I would not mind if somebody would do it though.
@DavidLyon66 That would be a huge undertaking.
Just the step to mark all entities during execution with code line numbers is difficult and requires code transformation. then taking cursor to that file location would be relatively easy to implement.
but intercepting editor changes to re-evaluate the script to only modify changed entity would be exponentionally more difficult. I would love to have time to develop something like that, but sadly I do not.
One thing that is doable is to perform faster render for parameter changes.. One thing that a developer writing the script can do is cache resulting objects baed on parameter values. and return the cached results for those objects that were not affected by parameter changes.
@Shunder0
i do not understand even slightest what you are asking here
@ucimo there are two plugins for vscode to preview jscad designs on the market.
Also you can edit your script in vscode and drag drop the file to https://openjscad.xyz after enabling auto-reload there. It will not work for typescript out of the box, but you can setup esbuild to bundle into js file and drag drop that file in openjscad for preview.
There is also https://jscad.app that is not yet official, it is a protoype for new jscad preview/edit . It supports typescript (transpiles it on the fly) and has some perf improvements too. If you feel chatty you can join the jscad discord channel also.
@Hermann-SW yes, the repo is better for bugs and features
@Hermann-SW do you have an github account ? This would be nicer as a github issue.
@Hermann-SW do you have an github account ? This would be nicer as a github issue.
@DBJDBJ did you try to drag and drop the folder onto the website instead ?
I tried the example from jscad repo: packages\examples\import\STLImport
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/examples/import/STLImport
I used the folder from the checked out code
and it worked with the button and with drag and drop.
Can you provide a link to zip file with the failing project?
@jumpjack2 you can export models from openscad or jscad to .obj or .stl meshes and then it is no more question of integrating with rapier, but a question of how you import meshes to rapier.
actual integration with jscad is much more complex problem.