George Hartzell wrote:
> I think I just connected the dots to a big reason to work with in the > 2D space: text is a 2d object and you can't mix it with 3d objects > like cubes.... Speaking of which, I haven't yet found a decent solution to produce engraved / embossed text where the 3D effect is chamfered rather than extruded out at a straight perpendicular. I can produce a base layer of 2D text, and using "offset" I can produce the smaller (still 2D) version that sits at the other end of the "extrusion" but what I can't do is join those two 2D objects to make a solid. Do I have to resort to interpolating at multiple different vertical positions and sizes to progressively dig out the text? That does work, but produces a much higher surface count than simply joining the two 2D polygons together vertex-by-vertex would. For 3D printing it's kinda OK, because I can set the interpolation on the Z axis to match the print resolution, but if I wanted proper smooth polygons for other purposes it doesn't look great, either. Ray -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
AFAIK, there is no neat way to do it in OpenSCAD. An approximation may be built with minkowski: it is time-consuming, generates more vertices than needed and rounds the character corners. chanfer_text("Text","Liberation Sans:style=Bold", 2, 10); module chanfer_text(text, font, h, ang) { d = h*tan(ang); minkowski(){ linear_extrude(height=h*0.0001) offset(-d) text(text, font=font); linear_extrude(height=h,scale=h*0.0001) circle(d); } } The offset may be suppressed depending on what you want. 2018-02-06 7:48 GMT-02:00 RayBellis <[hidden email]>: George Hartzell wrote: _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by RayBellis
In the Topic "DXF to "3D-printable" lines with thickness", I introduced a
small Python program to convert lines and arcs into function calls. I wrote modules to generate cylinder and torus pieces, but you can define your own modules that extrude chamfered sections or created chamfered arcs by combining cylinders and cones. I used it to engrave a motto onto a sigil. I drew the motto as text in LibreCAD, exploded the letters into lines and arcs, and used that as the input for the Python program. Mind you, you will still have some work defining the right modules, but at least it is a possibility. <http://forum.openscad.org/file/t1601/afdruk.png> You can download the program from http://www.w-p.dds.nl/dxflines2scad_py.txt (after download, rename it to "dxflines2scad.py") -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
This is what I came up with. I didn't try printing with it yet, but I think
it would work: module Embossed(step = 0.05, height = 1, grad = 0.5) { for (z = [ 0 : step : height ]) { translate([0, 0, z]) linear_extrude(height = step) offset(delta = -z * grad, chamfer = true) children(); } }; -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
This is a standard solution. Unhappily, besides the staircase surface, it is more time-consuming than using minkowski because of the union of many objects. It doesn't round corners, though. 2018-02-06 11:35 GMT-02:00 RayBellis <[hidden email]>: This is what I came up with. I didn't try printing with it yet, but I think _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Varying the second object in Ronaldo's code changes the effect... e.g. the following chamfers at 45 degrees (I think) in the X direction. chamfer_text("Text","Liberation Sans:style=Bold", 3, 10); module chamfer_text(text, font, h, ang) { d = h*tan(ang); minkowski(){ linear_extrude(height=h*0.0001) offset(-d) text(text, font=font); rotate([90,0,0]) linear_extrude(d) polygon(points=[[-d,0], [d,0],[0,d]]); } } On Wed, Feb 7, 2018 at 3:59 AM, Ronaldo Persiano <[hidden email]> wrote:
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Nice; to have the specified height and angle the polygon should be:
polygon(points=[[-d,0], [d,0],[0,h]])
2018-02-06 16:11 GMT-02:00 Frank van der Hulst <[hidden email]>:
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Here’s my solution to the same problem, using Minkowski… //(c)2018-01-06 Alex Gibson: admg chamfered text module //Licence: Creative Commons [CC BY-SA 4.0] https://creativecommons.org/licenses/by-sa/4.0/ module admg_chamfered_text(some_text_here,text_height,text_depth,chamfer_depth,chamfer_width) { translate([0,0,text_depth-chamfer_depth]) difference() { translate([0,0,-(text_depth-chamfer_depth)]) linear_extrude(text_depth) text(some_text_here,text_height,valign="center",halign="center"); minkowski() { difference() { cube([500,500,text_depth],center=true); translate([0,0,-text_depth]) linear_extrude(text_depth*2) text(some_text_here,text_depth*2,valign="center",halign="center"); } translate([0,0,text_depth/2]) cylinder(chamfer_depth,0,chamfer_width); } } } admg_chamfered_text("hello, world!",20,10,0.5,0.5); Alex Gibson +44 7813 810 765 @alexgibson3d 37 Royal Avenue, Reading RG31 4UR admg consulting edumaker limited · Project management · Operations & Process improvement · 3D Printing From: Discuss [mailto:[hidden email]] On Behalf Of Ronaldo Persiano Nice; to have the specified height and angle the polygon should be: polygon(points=[[-d,0], [d,0],[0,h]]) 2018-02-06 16:11 GMT-02:00 Frank van der Hulst <[hidden email]>: Varying the second object in Ronaldo's code changes the effect... e.g. the following chamfers at 45 degrees (I think) in the X direction. On Wed, Feb 7, 2018 at 3:59 AM, Ronaldo Persiano <[hidden email]> wrote: This is a standard solution. Unhappily, besides the staircase surface, it is more time-consuming than using minkowski because of the union of many objects. It doesn't round corners, though. 2018-02-06 11:35 GMT-02:00 RayBellis <[hidden email]>: This is what I came up with. I didn't try printing with it yet, but I think
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
This brings up a point I've been meaning to address. The linear extrude function has a "scale" parameter that can scale one end of the extrusion. It seems like a logical and useful addition to this would be an "offset" parameter, that would do the same thing, but offset the other end instead of scaling. It would solve this problem and many others. Of course, it might take some consideration, obviously, to ensure that it correctly handles areas that become zero-thickness (or negative-thickness) when a negative value for offset it used, as well as ensuring that the resulting object remains manifold when areas merge or holes close up. This makes it more complicated to implement than the existing scale parameter, but I think it would be a worthwhile addition. On February 6, 2018 at 15:13:47, Alex Gibson ([hidden email]) wrote:
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by alexgibson
@Gibson I guess your second text call should have the same parameters as the first one: text_height instead of text_depth*2. Anyway, I think you will get the same result with a simpler code:
2018-02-06 21:12 GMT-02:00 Alex Gibson <[hidden email]>:
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Hi Ronaldo, Sort of. While I’m pretty sure there are some redundancies in my code, it’s actually working slightly differently… Rather than being the minkowski sum of the letters and a cone so that the top surface is the original letter, and letters get wider and with rounded corners, instead I’m using minkowski() to make the equivalent of a tool path to subtract from the letters – the chamfering reduces the top surface and the outer edges of letters are the original font. Does that make sense? Have a look at the 2 side by side.
Both are potentially useful – I might make an updated 3D text library module that will allow you to select either and emboss or engrave, etc. There’s probably still some unnecessary translations I could weed out and I could potentially subtract from a simple cube rather than fully described letters – this was a rough solution to the same problem the OP was having… Cheers Alex Gibson +44 7813 810 765 @alexgibson3d 37 Royal Avenue, Reading RG31 4UR admg consulting edumaker limited · Project management · Operations & Process improvement · 3D Printing From: Discuss [mailto:[hidden email]] On Behalf Of Ronaldo Persiano . I guess your second text call should have the same parameters as the first one: text_height instead of text_depth*2. Anyway, I think you will get the same result with a simpler code:
2018-02-06 21:12 GMT-02:00 Alex Gibson <[hidden email]>: Here’s my solution to the same problem, using Minkowski… _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by Whosawhatsis
> The linear extrude function has a "scale" parameter that can scale one end > of the extrusion. It seems like a logical and useful addition to this > would be an "offset" parameter, that would do the same thing, but offset > the other end instead of scaling. It would solve this problem and many > others. I totally agree. For my sigil, which I intend to cast, I need all cut-out vertical walls to be slightly tapered, so that the final wax image does not break when the sigil is taken off. An offset parameter rather than a taper parameter would greatly help for detachable casting models. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Yes, being able to offset an extrusion (such that each edge within the 2D
polygon is offset relative to itself rather than from the shape's overall center c.f. how scale works) would be *very* useful. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
I am quite sure this has been discussed before but I couldn't find the thread. The idea was rejected (or perhaps postponed) exactly because the issues that may arise from offset An offset may change the number of vertices and the topology of a shape. A connected set may become disconnected and holes may disappear.
As the proponent, Whosawwhatis, said: " Of course, it might take some consideration, obviously, to ensure that it correctly handles areas that become zero-thickness (or negative-thickness) when a negative value for offset it used, as well as ensuring that the resulting object remains manifold when areas merge or holes close up. This makes it more complicated to implement than the existing scale parameter, but I think it would be a worthwhile addition."
2018-02-07 11:57 GMT-02:00 RayBellis <[hidden email]>: Yes, being able to offset an extrusion (such that each edge within the 2D _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In the area in which I work professionally, we call that "letting perfection
be the enemy of the good". In other words, just because it might not work in all conceivable situations, doesn't mean it shouldn't be done. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by alexgibson
Thank you, now I understood your code. It avoids to round "convex letter vertices" although the "concave vertices" are rounded what is less noticeable. Nice solution. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by RayBellis
See: https://github.com/openscad/openscad/pull/2079
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
|
This is something that could - in principle - be done in userspace if the
font geometry information were available. I'm not sure how hard it would be to make a '2Drender()' or 'textgeometry()'. Failing that, I guess you could scrape character geometry from postscript into a library. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
<http://forum.openscad.org/file/t2140/beveleda.png>
I think I'm getting the 'fins' from floating point rounding, and I have a workaround, but it's a bit of a chore to implement. roof.scad <http://forum.openscad.org/file/t2140/roof.scad> beveleda.stl <http://forum.openscad.org/file/t2140/beveleda.stl> -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Ok, so I think I've got the strange stuff worked out. ...
a.scad <http://forum.openscad.org/file/t2140/a.scad> text2.scad <http://forum.openscad.org/file/t2140/text2.scad> roof2.scad <http://forum.openscad.org/file/t2140/roof2.scad> Though it seems to run out of memory if I try to do "the quick brown fox jumps over the lazy dog." testtext.stl <http://forum.openscad.org/file/t2140/testtext.stl> -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Free forum by Nabble | Edit this page |