being offline from jscad for a while, I want to explore V2 now, because you added 3D hull lately.
I am slowly exploring V2 possibilities, sorry for any superfluous questions that result from that.
Some time ago (about a year?) I used a V1 environment for my work flow.
The environment used
- python design code that creates jscad files with scad like syntax
- jscad viewer, to display colored and transparent objects while designing
- cli to compile jscad into stl files to be used for 3D printing
The viewer could be started as
- desktop app
- web browser with a static viewer html file
- web server + web browser
- stl output and stl viewer
The web server variant is kind of difficult to use in a scripted environment and stl doesn't provide colors and transparency, so I usually used the other two.
I have some questions about the status of V2:
- which viewer interfaces are supposed to work?
- which do you use yourself for testing new code?
- the current viewer only works folder based? [EDIT: a single file works via drag and drop]
I already tried those and only got the web server to work, which doesn't fit well to my work flow (stateless). I guess it should still be possible to create a static viewer.html file (created on the fly by my scripts from a template) that can load and display a design. Any hint would be appreciated.
My V1 viewer template was like this:
== OpenJSCAD.org, Copyright (c) 2016-2017, Licensed under MIT License ==
in conjunction with other libraries by various authors (see the individual files)
This application provides an example of how to set Viewer options for BIG JSCAD designs
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>%FILE% - jscad v1 viewer</title>
<link rel="stylesheet" href="%STYLE%" type="text/css">
<!-- setup display of the errors as required by OpenJSCAD.js -->
<div class="jscad-container" style="width:100%;height:100%;border:none;padding:0;margin:0;" >
<div id="errordiv">ERROR: design could not be created or compiled</div><pre>%FILE%</pre>
<!-- setup display of the viewer, i.e. canvas -->
<div oncontextmenu="return false;" id="viewerContext" design-url="%FILE%"></div>
<!-- setup display of the status, as required by OpenJSCAD.js -->
<!-- set display: block to display this -->
<div id="tail" style="display: none;">
It was derived from the files used in the web server.
What would be an equivalent for V2?
I already tried viewer-minimal.html, viewer-options.html, which didn't show my jscad file (the included example doesn't show up neither),
I also tried to adapt demo.html, but there is no obvious way to specify a file.
note, I hadn't time to dive into source code, yet.