Chiseled Font?

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

Chiseled Font?

CasaDelGato
Anyone have some code to make a font use a V groove for the letters?
I'm looking to put some text on the bottom surface, and don't want to have supports.  
So a Font with a steep V shape for depth.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Chiseled Font?

JordanBrown
On 2/17/2020 7:14 PM, John Lussmyer wrote:
Anyone have some code to make a font use a V groove for the letters?
I'm looking to put some text on the bottom surface, and don't want to have supports.  
So a Font with a steep V shape for depth.


That would be hard.  I don't think you could use standard text() mechanisms to do it.

The problem is that the various layers are not straightforward transformations of one another.

Consider an H.  At the bottom layer, there's some center-to-center separation between the two vertical bars.  Call it W.  Each bar is a certain thickness.  Call that T.

You want T to scale down on successive layers, but you do *not* want W to scale down.

You want the proportions of the letters to change on different layers, with the strokes getting thinner but the basic shape of the letter staying the same size.  (Maybe you'd want the strokes that end, the tops and bottoms of the vertical bars, to get a little shorter so that you're slanted in that direction too.)

How big do you want your letters to be?  You might be able to get away with just bridging.

Before text() there was a font library written in OpenSCAD.  Maybe it had enough control to be able to tweak the stroke thickness without otherwise changing the shape or size of the letters.

---

For a different problem - text on a vertical surface - I had a general-purpose answer.  I'd extrude the text some thickness T, then T minus a little, shifted down a little, et cetera.  The result was that each stroke had a 45° bevel under it.


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

Re: Chiseled Font?

Ronaldo
In reply to this post by CasaDelGato
Is that what you want?

r = 1.5;
minkowski(){
  linear_extrude(3,scale=0.01) circle(r,$fn=16);
  linear_extrude(0.1)
  text("st",spacing=1.4,size=10);
}

Well, then be patient. This little code with just 2 letters required 55 sec in my computer to preview! After that, the render was a breeze.
Before doing the minkowski adjust the text spacing by offsetting the text with the radius of the circle. The slope will be extrusion height over the circle radius.

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

Re: Chiseled Font?

adrianv
If you're using an extrusion type printer, you should be able to bridge over
the text if is has vertical walls unless you make the text enormous.  

But if you really want to pursue V-groove text, it seems like what's needed
is the modify the text with offset().  The problem is that you can't connect
(concave) offset text with the original to create the groove.  (If writing
were convex then hull() would do the trick.) This process would be possible
if you had your text as a set of points, or as vectors using the offset()
function I wrote that takes a point list and performs the offset operation
on it.  



--
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: Chiseled Font?

OpenSCAD mailing list-2
In reply to this post by CasaDelGato
Another way to do this would be to use a font which is open, break up the
geometry, and then blend the inner and outer parts together.

Or, model this in a CAM tool which supports V carving and can export an STL.



--
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: Chiseled Font?

MathLover
In reply to this post by CasaDelGato
In this  topic
<http://forum.openscad.org/DXF-to-quot-3D-printable-quot-lines-with-thickness-td22235.html>  
I show how I did this with LibreCad and DXF files, and there are some good
suggestions of other approaches as well in the same topic.



--
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: Chiseled Font?

JordanBrown
In reply to this post by adrianv
On 2/18/2020 5:02 AM, adrianv wrote:
But if you really want to pursue V-groove text, it seems like what's needed is the modify the text with offset().

Ah!  You're right!

John, here's something for you to play with.
res = 2;    // Levels per unit height
slope=0.2;  // Units out per vertical unit
size=20;    // Height of font
height=10;  // Height of extruded letters

levels = height * res;

for (i=[0:levels-1]) {
    linear_extrude(height=(height-i/res))
        offset((i/res)*slope)
        text("hello", size=size);
}



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

Re: Chiseled Font?

Leea
I have wanted to play with something similar. The issue is this will be
read from the bottom, so each letter has to be flipped over. If you just
rotate the slope goes the wrong way. So how do you make the letter
appear backwards?

Lee

On 2/18/2020 12:54 PM, Jordan Brown wrote:

>
>     res = 2;    // Levels per unit height
>     slope=0.2;  // Units out per vertical unit
>     size=20;    // Height of font
>     height=10;  // Height of extruded letters
>
>     levels = height * res;
>
>     for (i=[0:levels-1]) {
>          linear_extrude(height=(height-i/res))
>              offset((i/res)*slope)
>              text("hello", size=size);
>     }
>
>


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

Re: Chiseled Font?

tp3
Ready made script to play with via customizer at https://www.thingiverse.com/thing:3089014

Note that all the fonts listed there would need to be installed locally to work. Thingiverse has most Google fonts installed.

ciao,
  Torsten.

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

Re: Chiseled Font?

lar3ry
In reply to this post by Leea
On 18 Feb 2020 at 13:10, Lee A wrote:

> I have wanted to play with something similar. The issue is this will be
> read from the bottom, so each letter has to be flipped over. If you just
> rotate the slope goes the wrong way. So how do you make the letter
> appear backwards?

Just add a rotate() before the text.

res = 2;    // Levels per unit height
slope=0.2;  // Units out per vertical unit
size=20;    // Height of font
height=10;  // Height of extruded letters

levels = height * res;

for (i=[0:levels-1]) {
                linear_extrude(height=(height-i/res))
                                offset((i/res)*slope)
        rotate([180,0,0])
                                text("hello", size=size);
}


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

Re: Chiseled Font?

acwest
I usually scale by -1 in the appropriate dimension for things like this

On Tue, 18 Feb 2020, 14:40 , <[hidden email]> wrote:
On 18 Feb 2020 at 13:10, Lee A wrote:

> I have wanted to play with something similar. The issue is this will be
> read from the bottom, so each letter has to be flipped over. If you just
> rotate the slope goes the wrong way. So how do you make the letter
> appear backwards?

Just add a rotate() before the text.

res = 2;    // Levels per unit height
slope=0.2;  // Units out per vertical unit
size=20;    // Height of font
height=10;  // Height of extruded letters

levels = height * res;

for (i=[0:levels-1]) {
                linear_extrude(height=(height-i/res))
                                offset((i/res)*slope)
        rotate([180,0,0])
                                text("hello", size=size);
}


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: Chiseled Font?

Leea
In reply to this post by lar3ry
Duh, I did it wrong.
Thanks

On 2/18/2020 1:39 PM, [hidden email] wrote:

> res = 2;    // Levels per unit height
> slope=0.2;  // Units out per vertical unit
> size=20;    // Height of font
> height=10;  // Height of extruded letters
>
> levels = height * res;
>
> for (i=[0:levels-1]) {
> linear_extrude(height=(height-i/res))
> offset((i/res)*slope)
> rotate([180,0,0])
> text("hello", size=size);
> }


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

Re: Chiseled Font?

JordanBrown
In reply to this post by acwest
On 2/18/2020 12:01 PM, A. Craig West wrote:
I usually scale by -1 in the appropriate dimension for things like this

The manual specifically warns against negative scales.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale

Note: Do not use negative scale values. Negative scale values appear to work for previews, but they lead to unpredictable errors when rendering through CGAL. Use the mirror() function instead.

And indeed, sticking a "mirror" on the front does the right thing.

res = 2;    // Levels per unit height
slope=0.2;  // Units out per vertical unit
size=20;    // Height of font
height=10;  // Height of extruded letters

levels = height * res;

mirror([0,0,1]) {
    for (i=[0:levels-1]) {
        linear_extrude(height=(height-i/res))
            offset((i/res)*slope)
            text("hello", size=size);
    }
}


Although the shape produced is the same, I'd prefer this to rotating the text, for two reasons:

1)  The result is readable.  Yes, you'd then want to rotate it to put it on the bottom, but you could also use it on the top or some other surface, with more obvious transformations.

2)  text() yields a 2D object.  Rotating a 2D object around X or Y, so that it comes out of the Z=0 plane, seems ... wrong.  It seems like it yields an object that is in some sense no longer 2D.  Yes, it ends up back at Z=0, but it seems like an incorrect operation to perform on a 2D object.

Here's an example of using this pattern on all sides of a cube:

res = 2;    // Levels per unit height
slope=0.15;  // Units out per vertical unit
size=20;    // Height of font
height=10;  // Height of extruded letters

levels = height * res;

epsilon = 0.01;

module engrave(t) {    
    mirror([0,0,1]) {
        for (i=[0:levels-1]) {
            linear_extrude(height=(height-i/res))
                offset((i/res)*slope)
                text(t, size=size, halign="center", valign="center");
        }
    }
}

difference() {
    cube(60, center=true);
    translate([0,0,30+epsilon]) engrave("hello");
    translate([0,30+epsilon,0]) rotate([-90,0,0]) engrave("hello");
    translate([0,-(30+epsilon),0]) rotate([90,0,0]) engrave("hello");
    translate([30+epsilon,0,0]) rotate([0,90,0]) engrave("hello");
    translate([-(30+epsilon),0,0]) rotate([0,-90,0]) engrave("hello");
    translate([0,0,-(30+epsilon)]) rotate([180,0,0]) engrave("hello");
}


Note:  that was very slow to display in preview, and took almost 17 minutes to render.  I haven't tried to figure out exactly why.



  


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

Re: Chiseled Font?

Parkinbot
JordanBrown wrote
> On 2/18/2020 12:01 PM, A. Craig West wrote:
>> I usually scale by -1 in the appropriate dimension for things like this
>
> The manual specifically warns against negative scales.

This opinion has come up several times in different threads - and I never
understood why, or found an example, why it shouldn't work. That it is
mentioned in the manual, doesn't prove that it is correct. Look at the
following:


mirror([0,0,1])
cube(1);

scale([1,1,-1])
cube(1);

after F5 the cfg file reads like this:

multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]) {
  cube(size = [1, 1, 1], center = false);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]) {
  cube(size = [1, 1, 1], center = false);
}

You can also check the other dimensions.
If negative values for such basic operation like scale were "forbidden" for
some reason, OpenSCAD should give at least a warning - and not rely on a
dubious "best practice" hint in the manual.







--
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: Chiseled Font?

TLC123
In reply to this post by CasaDelGato
Have a look at this:
Linear extrude offset
 https://github.com/openscad/openscad/pull/2079



--
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: Chiseled Font?

NateTG
In reply to this post by CasaDelGato
I did some fancy stuff generating text chamfers, but OpenSCAD doesn't give
good access to text geometry so I had to extract that from postscript.

http://forum.openscad.org/Chamfered-3D-text-td23162.html





--
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: Chiseled Font?

nophead
Doesn't scale with -1 turn the object inside out because it flips the vertices without fixing the winding order that gets reversed by the flip?

On Wed, 19 Feb 2020 at 17:45, NateTG <[hidden email]> wrote:
I did some fancy stuff generating text chamfers, but OpenSCAD doesn't give
good access to text geometry so I had to extract that from postscript.

http://forum.openscad.org/Chamfered-3D-text-td23162.html





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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: Chiseled Font?

JordanBrown
In reply to this post by Parkinbot
On 2/19/2020 8:36 AM, Parkinbot wrote:
If negative values for such basic operation like scale were "forbidden" for some reason, OpenSCAD should give at least a warning - and not rely on a dubious "best practice" hint in the manual.

I agree.  I'm only reporting what it says.  Indeed, I'd expect a negative scale to be exactly equivalent to a mirror, once you turn it all into a transformation matrix.

The caution was added by an anonymous user in January 2017.  It's entirely possible that they ran into some rendering problem that was unrelated, and blamed the wrong piece.

https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Manual/Transformations&diff=prev&oldid=3173552

Perhaps one of the people who is familiar with the internals can comment.

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

Re: Chiseled Font?

JordanBrown
In reply to this post by nophead
On 2/19/2020 9:55 AM, nop head wrote:
Doesn't scale with -1 turn the object inside out because it flips the vertices without fixing the winding order that gets reversed by the flip?



That was my guess, but I didn't see any evidence of it when I flipped a cube and looked at Thrown Together.  But I don't really understand that aspect of the system.


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

Re: Chiseled Font?

acwest
Mirror is likely to have the same effect, though. Unless it explicitly reverses the winding order, which would only be required depending on exactly how it is mirrored 

On Wed, 19 Feb 2020, 13:48 Jordan Brown, <[hidden email]> wrote:
On 2/19/2020 9:55 AM, nop head wrote:
Doesn't scale with -1 turn the object inside out because it flips the vertices without fixing the winding order that gets reversed by the flip?



That was my guess, but I didn't see any evidence of it when I flipped a cube and looked at Thrown Together.  But I don't really understand that aspect of the system.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
12