feature requests: glide() via Minkowski CGAL hooks, import_dxf(mode=glide), 2D primitive mode=glide

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

feature requests: glide() via Minkowski CGAL hooks, import_dxf(mode=glide), 2D primitive mode=glide

clothbot
Hey Marius,

Next up: feature requests!

I was poking around Minkowski stuff and noticed that Section 29.5, Figure 29.5 gives an example of how to sweep a polyhedron along a path:


Request 1:  Any chance you could implement a simple "glide()" function that does the same?  I'd like to be able to specify arbitrary paths to construct raised profiles (e.g. embossed vector text), channels (e.g. paths for electrically conductive material), etc.

Here's a hypothetical use example (borrowed from the 2D polygon() syntax) to construct a simple double helix frame:

myPoints=[ [-10,0,0],[10,0,0]
, [0,-10,2.5], [0,10,2.5]
, [10,0,5.0], [-10,0,5.0]
, [0,10,7.5], [0,-10,7.5]
, [-10,0,10], [10,0,10] ];
myPaths=[ [0,2,4,6,8], [1,3,5,7,9] // outer helix path
, [0,1], [2,3], [4,5], [6,7], [8,9] ]; // radials connecting adjacent helix points.
glide(points=myPoints, paths=myPaths ) 
sphere(r=1.0);

Request 2: Once that's done, my follow-up request would be for a "mode" parameter on import_dxf, where the default mode=area is the current filled-area behaviour.  With mode=glide, a union of glide() operations for each line segment would be performed instead of closed polygon areas.

import_dxf(file="static_files/oshw_logo_2d.dxf",mode=glide) {
cylinder($fn=16,r=2.0,h=4.0);
}

This could also help with debugging "problem" DXF files from other sources because paths need not be closed and even individual points (zero-length lines) would be rendered.


Request 3:  Enhance all the 2D primitive constructors to have mode=glide parameter.

square(size=[100,100],mode=glide) cylinder(r1=5,r2=0,h=5);


Thanks!

Andrew.

--

Makerbot Number Nine... #9... 0x09... 0o11... 0b1001... 
http://clothbot.com/wiki/MakerBotNumberNine



Reply | Threaded
Open this post in threaded view
|

Re: feature requests: glide() via Minkowski CGAL hooks, import_dxf(mode=glide), 2D primitive mode=glide

Giles Bathgate-2
On 14 April 2011 16:41, Andrew Plumb <[hidden email]> wrote:
> Hey Marius,
> Next up: feature requests!
> I was poking around Minkowski stuff and noticed that Section 29.5, Figure
> 29.5 gives an example of how to sweep a polyhedron along a path:
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Minkowski_sum_3/Chapter_main.html

There is already a stub for glide in gcaladv.cc

> Request 1:  Any chance you could implement a simple "glide()" function that
> does the same?  I'd like to be able to specify arbitrary paths to construct
> raised profiles (e.g. embossed vector text), channels (e.g. paths for
> electrically conductive material), etc.
> Here's a hypothetical use example (borrowed from the 2D polygon() syntax) to
> construct a simple double helix frame:
> myPoints=[ [-10,0,0],[10,0,0]
> , [0,-10,2.5], [0,10,2.5]
> , [10,0,5.0], [-10,0,5.0]
> , [0,10,7.5], [0,-10,7.5]
> , [-10,0,10], [10,0,10] ];
> myPaths=[ [0,2,4,6,8], [1,3,5,7,9] // outer helix path
> , [0,1], [2,3], [4,5], [6,7], [8,9] ]; // radials connecting adjacent helix
> points.
> glide(points=myPoints, paths=myPaths )
> sphere(r=1.0);
> Request 2: Once that's done, my follow-up request would be for a "mode"
> parameter on import_dxf, where the default mode=area is the current
> filled-area behaviour.  With mode=glide, a union of glide() operations for
> each line segment would be performed instead of closed polygon areas.
> import_dxf(file="static_files/oshw_logo_2d.dxf",mode=glide) {
> cylinder($fn=16,r=2.0,h=4.0);
> }
> This could also help with debugging "problem" DXF files from other sources
> because paths need not be closed and even individual points (zero-length
> lines) would be rendered.
>
> Request 3:  Enhance all the 2D primitive constructors to have mode=glide
> parameter.
> square(size=[100,100],mode=glide) cylinder(r1=5,r2=0,h=5);


All Those all seem like they could be accomplished with a single
syntax rather than changing adding parameters to all the existing
modules

e.g.

glide()
{
<2Dprimitive>
<3Dprimitive>
}

Then Request1 becomes:

 myPoints=[ [-10,0,0],[10,0,0]
 , [0,-10,2.5], [0,10,2.5]
 , [10,0,5.0], [-10,0,5.0]
 , [0,10,7.5], [0,-10,7.5]
 , [-10,0,10], [10,0,10] ];
 myPaths=[ [0,2,4,6,8], [1,3,5,7,9] // outer helix path
 , [0,1], [2,3], [4,5], [6,7], [8,9] ]; // radials connecting adjacent helix

 glide() {
  polygon(points=myPoints, paths=myPaths);
  sphere(r=1.0);
 }

Request2 becomes:

 glide() {
  import_dxf(file="static_files/oshw_logo_2d.dxf");
  cylinder($fn=16,r=2.0,h=4.0);
 }

Request3 becomes:

 glide() {
  square(size=[100,100]);
  cylinder(r1=5,r2=0,h=5);
 }

Regards

Giles Bathgate

Reply | Threaded
Open this post in threaded view
|

Re: feature requests: glide() via Minkowski CGAL hooks, import_dxf(mode=glide), 2D primitive mode=glide

chrysn
On Sun, Apr 17, 2011 at 06:43:14PM +0100, Giles Bathgate wrote:
> glide()
> {
> <2Dprimitive>
> <3Dprimitive>
> }

that would be great for simulating CAM (both additive and subtractive
methods) -- i'd appreciate such a feature very much.

chrysn

signature.asc (836 bytes) Download Attachment