ImplicitCAD icon indicating copy to clipboard operation
ImplicitCAD copied to clipboard

Integration of ImplicitCAD in ExplicitCAD

Open hannesweisbach opened this issue 5 years ago • 1 comments
trafficstars

In the spirit of not hijacking issues anymore I opened a new issue, because I'm actually a bit unhappy with the current interface between ExplicitCAD and openextcad/ImplicitCAD.

I just compiled implicitsnap, after figuring out it is not a snap-archived (https://snapcraft.io/) version of extopenscad ;) I knew about the online-viewer on implicitcad.org, but I forgot it was named snap.

I'm not much of (ok, not at all) a haskell programmer (altough I like that smileys are apparently valid haskell code), so I have a couple of questions:

(1) I want - at least in the long run - support OpenSCAD-style #, i.e. the following object(s) become transparent. This doesn't has to be the #-character, since it is used for comments in extopenscad. I like the feature for debugging as it makes invisible objects (for example inside a difference()) visible, and hence debugable. I often mess up a direction when translating an object, or an axis when rotating it, so seeing the difference between what I think I programmed and the compiled & rendered output let's me fix this stuff real easy.

As for implementation two ideas come to my mind: First, this can of course be implemented in extopenscad as first-class primitive. The downsides are that # already has the meaning for comments, it makes the renderer/parser more difficult, and ~~I don't know if output format such as STL even have the ability to attach something like attributes to objects~~ apparently it doesn't but OBJ does. Second, this can be implemented inside the viewer, i.e. ExplicitCAD. The downsides are that ExplicitCAD has to implement at least a rudimentary parser to find the end of # - probably the matching semicolon. Additionally ExplicitCAD has to overlay the resulting STLs i.e. parse all transformations up the root of the document. Still, I like the second version better, since this allows me to implement color, etc too. Maybe I can re-use the parser from ImplicitCAD for that?

(2) 2D-preview - I tried previewing 2D objects with ExplicitCAD and it complained about empty STLs. Which makes sense :) The previewer on implicitcad.org handles this case. I think it gives 2D objects just a little z-height, so they become 3D objects. Is this done inside the editor or inside implicitsnap/extopenscad/implicitcad?

hannesweisbach avatar Oct 15 '20 14:10 hannesweisbach

short answers(longer later):

1 is complicated. it's easy to make a section exist / not exist, but transparent is not a thing. 2 yes, it gives a touch of Z height.

julialongtin avatar Oct 16 '20 07:10 julialongtin