Nabble has removed Mailing-list integration.
Posts created here DO NOT GET SENT TO THE MAILING LIST.
Mailing-list emails DO NOT GET POSTED TO THE FORUM.
So basically the Forum is now out of date, we are looking into migrating the history.

For now you should send emails, people will see them, discuss@lists.openscad.org.

Rounded Polygon

classic Classic list List threaded Threaded
184 messages Options
1 ... 78910
Reply | Threaded
Open this post in threaded view
|

Re: Rounded Polygon

OpenSCAD mailing list-2
I completely understand not wanting to improve another library.

I'm finding it difficult to visualise your joining path problem sorry.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounded Polygon

adrianv
For the joining path problem, suppose I have two elliptical arcs and I want
to connect them end to end.  If I do this, I'll get a joint with a sharp
corner (most likely).  I want to be able to round over that corner.  So I'm
looking for a general scheme for connecting two paths end to end and
rounding the transition.  




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounded Polygon

OpenSCAD mailing list-2
In reply to this post by OpenSCAD mailing list-2
If it's of interest to anyone something I've added recently is a
polyRoundExtrude, which similar to my original polyRound api of defining [x,
y, r] points for polygons, it will extrude these points with rounded ends. I
had already implemented something similar for 2d children by extruding tiny
slices using offset, but found there were performance issues. The new method
uses the polyhedron and I've found it's much better, but can't be used for
2d children though.
The mesh looks like this.
<http://forum.openscad.org/file/t1892/Ee48hUUVoAUlH4S.jpg>
Api can be found here: https://kurthutten.com/blog/round-anything-api

and the original repo: https://github.com/Irev-Dev/Round-Anything



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounded Polygon

royasutton
In reply to this post by irevdev
Hello,

Love your example... I worked on a library several years back and there is a polygon rounding function hidden inside that I find myself using frequently. Had some spare time today and decided to pull it out of the library for easy access and to share for comments. Looks like it is very similar. Using your example for comparison.

Comparison

include <polytope.scad>;

points = [[-4,0],[5,3],[0,7],[8,7],[20,20],[10,0]];
radii = [1.5, 0.1, 10, 0.8, 10, 1];

polygon( points );
polygon( polygon2d_vertices_round3_p( c=points, vr=radii ) );

vfn = [30, 30, 3, 3, 3, 36];
polygon( polygon2d_vertices_round3_p( c=points, vr=radii, vfn=vfn ) );

modes = [1, 1, 0, 1, 4, 1];
polygon( polygon2d_vertices_round3_p( c=points, vr=radii, vrm=modes, vfn=30 ) );




The main difference I see:
- can be used on unmodified polygon coordinate lists
- each vertex can be rounded with an independent mode
- each vertex can be rounded with an independent $fn

Modes

Here is an example of the different modes:
include <polytope.scad>;

m = 25;
cord = [ [0, 0], [0, m], [m, m] ];

for ( x = [1:4], y = [1:3] )
{
  vrm = x + (y-1)*4;

  translate( [m*(x-1), m*(y-1)] * 1.5 )
  polygon( polygon2d_vertices_round3_p( c=cord, vr=m/4, vrm=[vrm,0,0] ) );
}



Mode Description

     mode | name                |        description
     :---:|:-------------------:|:--------------------------------------
       0  | none                | return vertex unchanged
       1  | round               | previous to next edge round
       2  | e-hollow / i-circle | previous to next edge inverse round
       3  | n-fillet            | next edge pass return fillet
       4  | p-fillet            | previous edge pass return fillet
       5  | chamfer             | previous to next edge bevel
       6  | e-circle / i-hollow | previous to next edge inverse round
       7  | n-round             | next edge pass return round
       8  | p-round             | previous edge pass return round
       9  | n-chamfer           | next edge pass return bevel
      10  | p-chamfer           | previous edge pass return bevel

I've posted the code on Thingiverse (thing = 5330083)
1 ... 78910