Navigation

    JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. z3dev
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by z3dev

    • Access to the (fake) FileSystem in WEB Applications

      Here's something for those wanting 'more' from JSCAD designs.

      The 'fs' (File System) module is available to designs, both NODE.js and WEB versions.

      const fs = require('fs')
      

      The WEB versions is not 100% compatible, but it can provide access to other data. For example, fonts can be added to the contents of a JSCAD project. And the font can be read via the 'fs' module.

      const data = fs.readFileSync('project_text/Osaka.ttf')
      

      And used with the jscad-text project, outlines of characters can be created very easily.

      const {primitives} = require('@jscad/modeling')
      
      const { loadFontFromData, textToPaths } = require('./jscad-text')
      
      const fs = require('fs')
      
      const main = (params) => {
        const data = fs.readFileSync('project_text/Osaka.ttf')
      
        const font = loadFontFromData(data)
      
        const paths = textToPaths({font, segments: 144}, 'JSCAD! 大好きです!')
      
        return paths
      }
      
      module.exports = { main }
      

      5.png

      posted in Development Discussions
      z3dev
      z3dev
    • V2 Update 2020 Nov 11

      Please get the latest version of JSCAD V2, as there have been some changes as well as bug fixes.

      There are now four pre-packed libraries. NOTE: Some of the library names have been changed.

      • core: jscad-core.min.js, UMD library exporting 'jscadCore'
      • modeling: jscad-modeling.min.js, UMD library exporting 'jscadModeling'
      • web: jscad-web.min.js, UMD library exporting 'jscadWeb'
      • regl-renderer: jscad-regl-renderer.min.js, UMD library exporting 'jscadReglRenderer'

      For more information see the README file for the packages.

      New Features:
      all: standardize package contents, improving published packages
      core: added build script and configuration for publishing

      Bug Fixes:
      io: corrected all meta data in deserializer and serializers, and corrected to use package version in meta data
      io-utils: split out Blob and converted to ES5 class, added test suite
      io-utils: converted BinaryReader to ES5 class
      modeling: corrected extrudeWalls to ignore invalid polygons(walls) which occurs if slices overlap
      modeling: corrected slice creation for negative (-x) biased shapes
      regl-renderer: corrected orientation of presets
      regl-renderer: adjusted default rotation rate for auto-rotate
      regl-renderer: corrected entitiesFromSolids to use transforms from geometries
      regl-renderer: corrected zoomToFit to ignore 2D geomerties and visual entites (draw commands)
      web: corrected keyboard shortcuts and selection of auto-rotate
      web: changed the file system watcher to use setTimeout(), and calculate dynamic delays
      web: changed intial camera position so X and Y axis point to positive coordinates

      Successfully published:

      • @jscad/cli@2.0.0-alpha.10
      • @jscad/core@2.0.0-alpha.10
      • @jscad/examples@2.0.0-alpha.5
      • @jscad/amf-deserializer@2.0.0-alpha.7
      • @jscad/amf-serializer@2.0.0-alpha.8
      • @jscad/dxf-deserializer@2.0.0-alpha.7
      • @jscad/dxf-serializer@2.0.0-alpha.7
      • @jscad/io-utils@2.0.0-alpha.7
      • @jscad/io@2.0.0-alpha.9
      • @jscad/json-deserializer@2.0.0-alpha.7
      • @jscad/json-serializer@2.0.0-alpha.7
      • @jscad/obj-deserializer@2.0.0-alpha.7
      • @jscad/stl-deserializer@2.0.0-alpha.8
      • @jscad/stl-serializer@2.0.0-alpha.7
      • @jscad/svg-deserializer@2.0.0-alpha.7
      • @jscad/svg-serializer@2.0.0-alpha.8
      • @jscad/x3d-serializer@2.0.0-alpha.8
      • @jscad/modeling@2.0.0-alpha.7
      • @jscad/array-utils@2.0.0-alpha.4
      • @jscad/img-utils@2.0.0-alpha.4
      • @jscad/regl-renderer@2.0.0-alpha.9
      • @jscad/vtree@2.0.0-alpha.8
      • @jscad/web@2.0.0-alpha.12

      BIG NOTE: The V2 website is also using this release.

      There's on-line documentation as well for those needing additional information about the modeling API.

      For those using a local copy of JSCAD V2, be sure to run the following commands.

      git pull
      npm run clean (and answer Y)
      npm run bootstrap
      

      Both CLI and WEB UI are usable for creating designs. In the WEB UI, it's best to drag-n-drop project folders to the window, and work with the pieces via a favorite editor. If "Enable auto reload" is checked then changes will be detected, and rendered again.

      For those wanting to get hold of JSCAD V2, it's still in 'early adoption' mode. But you can get started here.

      And a BIG THANKS for everyone that has provided feedback. Keep those comments coming!

      posted in Development Discussions
      z3dev
      z3dev
    • RE: V2 JSCAD Packages Available!

      @BarbourSmith Thanks.

      I noticed that as well. For now, you'll have to manually switch the version to 'alpha'.

      posted in Announcements
      z3dev
      z3dev
    • Maker Faire Tokyo 2019

      Maker Faire Tokyo 2019
      日時:2019年8月3日(土)、8月4日(日)
      会場:東京ビッグサイト(東京都江東区有明3-11-1)
      アナウンス: https://makezine.jp/blog/2019/01/mft2019_announce.html

      Maker Faire Tokyo 2019
      Dates: August 3rd to August 4th
      Place: Tokyo Big Site
      Announcement: https://makezine.jp/blog/2019/01/mft2019_announce.html

      I’m hoping to show JSCAD again this year. Let me know if you’re in town.

      posted in General Discussions
      z3dev
      z3dev
    • JSCAD V2 Update

      It’s been a while since we have posted any update on V2, so here’s a few notes on what’s going on.

      First, the reorganization of the CSG library is almost done, but like always the last 5% takes the most time. Once again, the major goals are:

      • Move to functional API, i.e. no more monolithic objects
      • Standardized function names, parameters, error checks, etc.
      • Lots of small modules to allow more reuse
      • Math and Geometry data structures based on arrays
      • Tests for everything

      There have been some name changes to functions, but the new names are clear. Parameter names haven’t changed much, but one major change is the usage of RADIANS for all angles and rotations. There are several bug fixes and improvements as well. Tests… yeah… lots… 394 test suites with over 90% coverage.. and this will continue to improve.

      Second, all JSCAD libraries are being brought together into one repository; OpenJSCAD.org. This allows the libraries to be managed together, and produce releases faster. And hopefully, contributions from anyone at any level will be easier. This includes the CSG library, IO library, and new viewer.

      Third, you can start following along. There are still a few major changes coming, but you can already get a good feel for things by cloning the OpenJSCAD.org repository, and looking at the V2 branch.

      Feel free to ask any questions about V2.

      posted in Development Discussions
      z3dev
      z3dev
    • Release : 2021 APR 15

      There's a new release of JSCAD, including changes from several previous pull requests.

      Fixes:
      modeling: correced snapPolygons to remove duplicate vertices which is possible (#791) (1eaf86f)
      regl-renderer: corrected zoomToFit for 2D geometries (#793) (2a05d3e)

      Successfully published:

      • @jscad/cli@2.1.0
      • @jscad/core@2.1.0
      • @jscad/examples@2.1.0
      • @jscad/amf-deserializer@2.0.1
      • @jscad/amf-serializer@2.0.1
      • @jscad/dxf-deserializer@2.1.0
      • @jscad/dxf-serializer@2.0.1
      • @jscad/io-utils@2.0.1
      • @jscad/io@2.0.1
      • @jscad/json-deserializer@2.0.1
      • @jscad/json-serializer@2.0.1
      • @jscad/obj-deserializer@2.0.1
      • @jscad/stl-deserializer@2.0.1
      • @jscad/stl-serializer@2.0.1
      • @jscad/svg-deserializer@2.1.0
      • @jscad/svg-serializer@2.1.0
      • @jscad/x3d-serializer@2.1.0
      • @jscad/modeling@2.1.0
      • @jscad/array-utils@2.0.1
      • @jscad/img-utils@2.0.1
      • @jscad/regl-renderer@2.0.1
      • @jscad/vtree@2.0.1
      • @jscad/web@2.1.0
        lerna success published 23 packages
      posted in Announcements
      z3dev
      z3dev
    • Maker Faire Tokyo 2019

      We had a great time showing JSCAD at Maker Faire, showing both V1 and V2 (alpha alpha) to folks, as well as entertaining kids with a small toy designed with JSCAD. As usual, the faire was packed both Saturday and Sunday.

      3_1565402041636_IMG_1700.JPG 2_1565402041636_IMG_1699.JPG 1_1565402041636_IMG_1716.JPG 0_1565402041636_IMG_1719.JPG

      posted in General Discussions
      z3dev
      z3dev
    • V2 Offset

      There's some new functionality coming with V2, which is pretty exciting. So, I thought a little preview would be nice.

      This is the new offset() function, which can calculate the offset of a path or a 2D geometry.

      Here's a photo of a line (black) being offset both positive (green) and negative (red), with rounded corners.

      0_1565853648828_offset_path_4.png

      And here's a simular image of a 2D geometry, but note that this geometry has a hole. So, offsets are applied to both inside and outside edges. In this case, the corners are only connected at the intersection of the edges.

      0_1565853755948_offset_geom2_5.png

      Hope you like this one!

      posted in Development Discussions
      z3dev
      z3dev
    • RE: How do I share the parametric model without sharing the code?

      @kevinos welcome!

      The JSCAD model (code) is required as the compilation is completed by the browser. So, you will have to find ways to obfuscate the code.

      posted in General Discussions
      z3dev
      z3dev
    • V2 Performance

      So, it's time for another update on V2 progress.

      We have been busy finishing those last 5% of changes to the CSG library, which is DONE!!! 🙌 And now, those changes are being merged into the larger repository (OpenJSCAD.org) as V2 changes.

      There's a lot of COOL things in V2. 😎

      As mentioned earlier, all of V2 has full test coverage, so we now know when changes break things. And, we have also been working on some performance tests as well, in order to know when performance is affected.

      I thought you'd be interested...

      Here's a comparison of V2 performance versus V1 performance. Note that comparisons are not apples to apples, but you'll get an idea of what's improving. Also, we now know where we need to improve as well.

      PDF File

      posted in Development Discussions
      z3dev
      z3dev
    • RE: Has anyone had success using openjscad in react?

      @kevinos no problem.

      so, JSCAD designs are actually Javascript functions which perform calcuations, create geometry, perform operations with geometry, and finally return the geometry of interest.

      const {primitives} = require('@jscad/modeling')
      
      const main = () => {
        let object1 = primitives.circle({radius: 22, segments: 36})
        object1.color = [1,0,0,1]
      
        return object1
      }
      module.exports = {main}
      

      The return of object1 from main() is a 2D geometry, i.e. a geom2 object. In the WEB UI, this object is passed to the 'rendering' function, and shows up on the screen as a red circle.

      The Vue component requires 2D/3D geometries as well. And as a Vue component, it can live inside another Vue component (or application). This is the rendering piece only.

      The JSCAD WEB UI is doing a whole lot more underneath. It loads all the code, evaluates (compiles?) each piece of code, and finally executes the main() function.

      If you want this functionality then there's some more plumbing required.

      posted in General Discussions
      z3dev
      z3dev
    • V2 Update

      HEADS UP! Please get the latest version of JSCAD V2, as there have been some BIG name space changes in the modeling API.

      • math => maths
      • geometry => geometries

      These are the last major changes to the modeling API, as all big changes have been completed.

      The WEB UI is now quite usable for creating designs. It's best to drag-n-drop project folders to the window, and work with the pieces via a favorite editor. If "Enable auto reload" is checked then changes will be detected, and rendered again.

      For those wanting to get hold of JSCAD V2, it's still in 'early adoption' mode. But you can get started here.

      And a BIG THANKS for everyone that has provided feedback. Keep those comments coming!

      posted in Development Discussions
      z3dev
      z3dev
    • RE: Has anyone had success using openjscad in react?

      @kevinos sure.

      here's the code https://github.com/z3dev/vue-components

      this is only a viewer for a pre-compiled (JSON) design. V2 only!

      posted in General Discussions
      z3dev
      z3dev
    • V2 Update : 2020 SEP 18

      Please get the latest version of JSCAD V2, as there have been some major bug fixes, and new functional enhancements.

      WEB UI now has touch gestures for mobile devices, across all browsers (except Explorer which is not ES6 compliant.)

      There's a new align function which can align a set of objects using various X, Y, and Z orientations, as well as centers. Thanks to @SimonClark for the contribution!

      New Features:

      modeling: add transforms.align() and measurements.measureAggregateBoundingBox() functions
      dxf-serializer: (export) added support for colors
      svg-deserializer: (import) added support for segments option

      Bug Fixes:

      web: fix json import
      web: support sparse arrays from main() (fixes from @MathieuLoutre)
      web: V2 enable multi-gesture touch events for mobile devices

      For those already using JSCAD V2, be sure to run the following commands.

      git pull
      npm run clean (and answer Y)
      npm run bootstrap
      

      Both CLI and WEB UI are usable for creating designs. In the WEB UI, it's best to drag-n-drop project folders to the window, and work with the pieces via a favorite editor. If "Enable auto reload" is checked then changes will be detected, and rendered again.

      For those wanting to get hold of JSCAD V2, it's still in 'early adoption' mode. But you can get started here.

      And a BIG THANKS for everyone that has provided feedback. Keep those comments coming!

      posted in Development Discussions
      z3dev
      z3dev
    • RE: A newbie's self introduction

      @Cid-Zhang Thanks! And, welcome!

      Your models look very cool. I'm sure that others will enjoy creating various hinged shapes as well.

      Please let us know if you need some assistance with JSCAD. There are lots of very experienced users in the group.

      posted in General Discussions
      z3dev
      z3dev
    • RE: V2 Update : 2020 SEP 18

      I forgot to mention that the renderer now includes a packaged library. See 'packages/utils/regl-renderer/dist/reglRenderer.js'

      This library can be used standalone in websites to render JSCAD geometries. This is for developers that want to implement other javascript components, like React.js based components, etc.

      posted in Development Discussions
      z3dev
      z3dev
    • RE: A prototype of jscad application

      P.S. Here's another example. It actually implements the gears that you mentioned. 🙂

      http://www.knowhave.com/gear/worm.php

      posted in General Discussions
      z3dev
      z3dev
    • RE: Symmetrical Json Deserializers

      @Maria-Alzate welcome

      Yes. All serializers/deserializers should be symmetrical. JSON should always be so.

      Each of the V2 deserializers has an option called 'output'. You can specify 'script' to get a JSCAD script, or 'geometry' to get an array of V2 data structures.

      Also, the CLI can convert between formats using the -of <output format> option.

      V2 has not been published to NPM as of today. If interested in V2 then please see the early adoption notes.

      P.S. There's a bug in the WEB UI that prevents drag and drop of JSON files. A fix is in progress.

      posted in Development Discussions
      z3dev
      z3dev
    • RE: A prototype of jscad application

      @Cid-Zhang Super cool! 😎

      I tend to agree with you about the 'scope' of projects. There are plenty of great CAD applications and trying to duplicate those with JSCAD (using JavaScript) would be almost impossible. Even the JSCAD website (www.jscad.xyz) has too much functionality.

      Your project is a good example of what can be done, and hopefully lots of people will be interested in using the new website to create cool 3D printed designs.

      As part of the JSCAD organization, we have often hit upon the idea of providing a catalog of designs. And there are actually some active catalogs today. Should a catalog be part of the JSCAD website?

      posted in General Discussions
      z3dev
      z3dev
    • V2 Update : 2020 SEP 28

      Please get the latest version of JSCAD V2, as there have been some bug fixes, and new functional enhancements.

      There are new aggregate functions which calculate values for a set of objects. Thanks to @SimonClark for the contribution!

      New Features:
      modeling: added aggregate functions for area, volume, epsilon measurements

      Bug Fixes:
      web: fix loading of designs from remote URLs
      web: web layout tweaks
      modeling: - expanded checking of parameters on all primitives

      **BIG NOTE: The V2 website is also using this release. **

      For those already using JSCAD V2, be sure to run the following commands.

      git pull
      npm run clean (and answer Y)
      npm run bootstrap
      

      Both CLI and WEB UI are usable for creating designs. In the WEB UI, it's best to drag-n-drop project folders to the window, and work with the pieces via a favorite editor. If "Enable auto reload" is checked then changes will be detected, and rendered again.

      For those wanting to get hold of JSCAD V2, it's still in 'early adoption' mode. But you can get started here.

      And a BIG THANKS for everyone that has provided feedback. Keep those comments coming!

      posted in Development Discussions
      z3dev
      z3dev