Git Product home page Git Product logo

openscad_stuff's Introduction

unionRoundMask.scad

unionRound

addressing issue 844

////////////////////////////////////////////////////////
/*
unionRound() 1.0 Module by Torleif Ceder - TLC123 late summer 2021
 Pretty fast Union with radius, But limited to a subset of cases
Usage 
 unionRound( radius , detail  )
    {
     YourObject1();
     YourObject2(); 
    } 
  unionRoundMask (r, detail , epsilon ,showMask )
    {
     YourObject1();
     YourObject2(); 
     YourMask();
     YourMask(); // multi-mask not implemented
     
     // ...
     // ...
     // ...
     
    } 
limitations: 
 0. Only really fast when boolean operands are convex, 
        Minkowski is fast in that case. 
 1. Boolean operands may be concave but can only touch 
        in a single convex area
 2. Radius is of elliptic type and is only approximate r
        were operand intersect at perpendicular angle. 
*/
//////////////////////////////////////////////////////// 

on Youtube

on GitHub

on Thingiverse

on OpenSCAD Snippet Pad

on r /OpenSCAD

functional_extrude.scad functional_extrude

polyround3d.scad

image!

openscad_stuff's People

Contributors

tlc123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openscad_stuff's Issues

unionRound() fails for (some) non-convex operands

I have tried unionRound with:

    unionRound(1, 2) {
        translate([2, 5, 5]) union() { sphere(6); cylinder(8); }
        rotate([10, 20, 30]) cube(10, true);
    }

and it fails to respect the detail argument; in fact, it fails also with detail=4 although it seems to be fine with detail=3 or 1.
I could not understand why.

Besides, I got a fast (and apparently correct) results for non-convex operands masking the region around their intersection. That will be fast provided that the operand intersection is convex. The simple mask I used was :

module mask(i,r) {
    intersection() {
        children(i) ;
        clad(r) intersection() { children(0); children(1); }
    }
}

That mask would be used as: mask(0,r) { children(0); children(1); };
instead of children(0);
in all places it is appears under the hull(). The same is done with children(1).

About refinemesh.scad

The refine() function is not returning a mesh satisfying the criteria expressed by its argument limit. I could not realize why but confirmed it by the following two lines:

edges = let(v=bendt[0])[for(f=bendt[1],lf=len(f),i=idx(f)) norm(v[f[i]]-v[f[(i+1)%lf]]) ]; 
echo(min_edge=min(edges), max_edge=max(edges));

Besides, function glue() does not eliminate all non referred vertices and there are many of them in the final mesh. Usually that is not a problem but it may overload any following processes on vertices.

Finally, as you are including BOSL2 library, you may benefit of using BOSL2 function unique that seems to be faster than yours for larger lists. Your unique() seems to be O(n2) while BOSL2 unique is O(n log n) thanks to a special sort.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.