JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. hg42
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 10
    • Best 0
    • Controversial 0
    • Groups 0

    hg42

    @hg42

    0
    Reputation
    469
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location Germany

    hg42 Unfollow Follow

    Latest posts made by hg42

    • RE: V2 status and testing environments

      I switched between branches by checking it out and running
      npm run clean ; npm install ; npm run bootstrap ; npm test
      and
      npm run web

      Switching back to "V2" results in this (seems to be the same geometry, but less white faces):
      [EDIT: below is a sphere of radius 1, the white version was radius 5 and looks identical]

      0_1590606942959_670e34df-e620-4ae7-bc10-d604a0072c95-image.png

      four stripes seem to be ok:
      0_1590607038613_0052637f-deee-4871-b58b-2acae2988ae4-image.png

      posted in Development Discussions
      hg42
      hg42
    • RE: V2 status and testing environments

      well...another test on branch V2-fix-compact-binaries (at 0821a594) works...

      posted in Development Discussions
      hg42
      hg42
    • RE: V2 status and testing environments

      I am not sure if my environment is correct or if I am doing something weird.
      So I ask here first, I guess it's some work in progress.

      I started by following this guide:
      https://openjscad.org/dokuwiki/doku.php?id=early_v2

      branch V2 is at 828394dd

      npm test results in lerna success for all modules (and I only see "test passed" and "known failures").

      I used npm run web as viewer (with drag and drop).

      However, my simple test file that worked at some time recently doesn't work now.

      Then I switched to branch "V2-enhance-webrequire" (at 32e74b5f) as it seems to have some fixes...just for a test...
      I now used
      packages/examples/testV2.js
      (hope that's an official file).

      The result is this:
      0_1590599369615_4c811884-0ce9-415a-a36c-9149fe885dbd-image.png

      using this simple file (following the example in the "V2 Hull" post):

      const {primitives} = require('@jscad/modeling')
      
      const main = () => {
      
        return [
          primitives.ellipsoid({radius: [5,5,5]})
        ]
      }
      
      module.exports = {main}
      

      I got this:
      0_1590600045968_d8ad710a-0379-47b3-b734-20a01e24874d-image.png

      This branch has identical result to "V2".
      Also, both tests are identical in Firefox 76.0.1 or Chromium 80.0.3987.163 or Chrome 83.0.4103.61.

      I guess you don't have such results, so what could have gone wrong? any idea?

      posted in Development Discussions
      hg42
      hg42
    • RE: V2 Hulls

      @z3dev for my purposes the type of api doesn't matter much, because I use a preprocessor (currently python, may be something like livescript in the future) that can generate whatever I need. Ideally I would use the lowest level.

      That said, I could eventually use javascript as a frontend directly. It's a whole different situation with jscad compared to openscad as a backend.

      My preprocessor generates a tree internally (which seems to be very similar to the vtree).
      So, the transition to jscad could also be from my tree to vtree...

      btw. I already created a new thread for further discussions, because I thought it would not fit well under "V2 hulls"):
      v2-status-and-testing-environments

      posted in Development Discussions
      hg42
      hg42
    • V2 status and testing environments

      Hi,

      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:

      <!DOCTYPE html>
      <html>
      <!--
      
      == OpenJSCAD.org, Copyright (c) 2016-2017, Licensed under MIT License ==
         in conjunction with other libraries by various authors (see the individual files)
      
      Purpose:
        This application provides an example of how to set Viewer options for BIG JSCAD designs
      -->
      <head>
        <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">
      </head>
      
      <body>
        <script src="%FRAMEWORK%"></script>
      <!-- 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="header">
            <div id="errordiv">ERROR: design could not be created or compiled</div><pre>%FILE%</pre>
          </div>
      
      <!-- 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;">
            <div id="statusdiv">STATUS</div>
          </div>
        </div>
      </body>
      
      </html>
      

      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.

      posted in Development Discussions
      hg42
      hg42
    • RE: V2 Hulls

      @z3dev well, 14 days seems to be quick in relation to my replay after 5 month ☺
      Thanks...

      Meanwhile, I read some code and other sources. I see it's a work in progress (naturally) and several things probably don't work any more or at least temporarily.

      The code above helps to understand, what is your current way to test code. Actually, I wasn't fully aware of the pure functional interface.

      posted in Development Discussions
      hg42
      hg42
    • RE: V2 Hulls

      Hi,

      after being offline from JSCAD for some time now, I am slowly trying to get back to a new working environment, now using V2. I know it's not production ready, which doesn't matter for me, it's only an exploration and I also want to help with testing or ideas etc.

      While having several issues currently (mainly understanding how to do things in V2 and current status of the new code), it would probably help (me), if you could post the code you used for these images (or a pointer to it).

      posted in Development Discussions
      hg42
      hg42
    • RE: Hello !

      @gilboonet thanks for the links...

      When I find some free time, I will definitely dig into it.

      Currently, I have too many projects in parallel, to add another fascinating one 🙂

      posted in General Discussions
      hg42
      hg42
    • RE: Hello !

      a hello from me, too!

      @gilboonet that's an awesome project, I guess they love it...

      is there a repo or a web site or any other pointers?
      I think, I could also recycle some of my card board garbage...

      posted in General Discussions
      hg42
      hg42