JSCAD User Group

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

    DrShoggoth

    @DrShoggoth

    0
    Reputation
    85
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    DrShoggoth Unfollow Follow

    Latest posts made by DrShoggoth

    • RE: Non manifold geometry with polyhedron

      Nevermind, I fixed everything simply by using triangles instead of polygons.

      posted in General Discussions
      D
      DrShoggoth
    • RE: Non manifold geometry with polyhedron

      It's completely fine until I operate on it with any other geometry.
      0_1589397289948_Screenshot from 2020-05-13 14-14-17.png

      posted in General Discussions
      D
      DrShoggoth
    • RE: Non manifold geometry with polyhedron

      I double checked my polygons and they are all clockwise if you are facing them.

      posted in General Discussions
      D
      DrShoggoth
    • Non manifold geometry with polyhedron

      I'm trying to generate threads and I'm there for the most part. As soon as I do any boolean operations with other geometries I end up with non-manifold geometries. I'm assuming that I am either misunderstanding how to use polyhedron() or I'm defining its polygons wrong. Does anybody know what I can do?

      function main() {
      const r = 10;
      const fn = 32;
      const h = 10;

      numSegments = (h+1)*fn;

      const points = seq(numSegments+1).flatMap( i => threadTriangle(r,360/fn*i,i/fn-1) );

      const closeFirst = [0,1,2];
      const segments = seq(numSegments).flatMap( i => {
      const m = i*3;
      return [
      [0,3,4,1].map(x => x+m),
      [1,4,5,2].map(x => x+m),
      [2,5,3,0].map(x => x+m)
      ];
      })
      const closeLast = [
      points.length-1,
      points.length-2,
      points.length-3,
      ];

      const threadPoly = polyhedron({
      points,
      polygons: [ closeFirst, ...segments, closeLast ]
      });

      const threadPolyTrimmed = intersection(
      threadPoly,
      cylinder({r:r+0.5,h,fn})
      );

      return union(
      threadPolyTrimmed,
      cylinder({r:r,h,fn})
      );

      }

      function threadTriangle(r,a,z) {
      const rad = a * Math.PI/180;
      const x1 = r * Math.cos(rad);
      const y1 = r * Math.sin(rad);

      const x2 = (r+0.475) * Math.cos(rad);
      const y2 = (r+0.475) * Math.sin(rad);

      return [[x1,y1,z],[x1,y1,0.95+z],[x2,y2,0.5+z]];
      }

      function seq(length) {
      return Array.apply(null, {length}).map(Function.call, Number);
      }

      posted in General Discussions
      D
      DrShoggoth
    • Parametric Lego brick generator

      Built this yesterday for fun, thought I would share.
      brick_generator.jscad

      posted in General Discussions
      D
      DrShoggoth