discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How to difference shape with text?

C
Cerin
Fri, Dec 26, 2014 5:54 AM

How do you perform a boolean difference between a shape and a block of text?

I'm trying to model an "N" cutout of a cube.

Since OpenSCAD doesn't natively support text, I'm using Write.scad
(http://www.spolearninglab.com/curriculum/lessonPlans/hacking/resources/software/3d/openscad/openscad_write.html)
to create the "N" shape. This is simply:

use <Write.scad>
write("N");

and of course adding a cube makes it:

use <Write.scad>
cube(1);
write("N");

From how I understand the difference operation, differencing these two

should be simply:

use <Write.scad>
difference{
    cube(1);
    write("N");
}

However, when I run this, the view pane turns black and nothing renders.
What am I doing wrong?

--
View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

How do you perform a boolean difference between a shape and a block of text? I'm trying to model an "N" cutout of a cube. Since OpenSCAD doesn't natively support text, I'm using Write.scad (http://www.spolearninglab.com/curriculum/lessonPlans/hacking/resources/software/3d/openscad/openscad_write.html) to create the "N" shape. This is simply: use <Write.scad> write("N"); and of course adding a cube makes it: use <Write.scad> cube(1); write("N"); >From how I understand the `difference` operation, differencing these two should be simply: use <Write.scad> difference{ cube(1); write("N"); } However, when I run this, the view pane turns black and nothing renders. What am I doing wrong? -- View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Dec 26, 2014 6:06 AM

Try "difference()", but have a look at just the write so you know the size
and orientation of the N v's the cube.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10725.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Try "difference()", but have a look at just the write so you know the size and orientation of the N v's the cube. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10725.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Dec 26, 2014 6:09 AM

BTW if you are using the dev snapshot see  text()
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text  . It is 2D, if
you want to use it for 3D you need to linear_extrude() it.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10726.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

BTW if you are using the dev snapshot see text() <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text> . It is 2D, if you want to use it for 3D you need to linear_extrude() it. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10726.html Sent from the OpenSCAD mailing list archive at Nabble.com.
C
Cerin
Fri, Dec 26, 2014 6:14 AM

I'm using 2014.03, not the dev version. Is this not possible with the
stable version? I am using difference(), so I'm not sure what you mean by
"try difference()". I did have a typo in my original email, I meant to
include the parens. To keep it simple, I excluded the transformations. The
full code is:

use <Write.scad>
difference() {
translate([-1, -1, -1]) {
cube(6);
}

translate([0, 0, -3]) {
scale([1.5, 1, 10]){
    write("N");
}}

}

Commenting out the difference shows an N stretching out of the top of a
cube.

On Fri, Dec 26, 2014 at 1:09 AM, MichaelAtOz [via OpenSCAD] <
ml-node+s1091067n10726h15@n5.nabble.com> wrote:

BTW if you are using the dev snapshot see text()
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text. It is 2D, if
you want to use it for 3D you need to linear_extrude() it.

Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :)
Inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/


If you reply to this email, your message will be added to the discussion
below:

http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10726.html
To unsubscribe from How to difference shape with text?, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=10724&code=Y2hyaXNzcGVuQGdtYWlsLmNvbXwxMDcyNHwxMjg4NzkwNjM4
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

--
View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10727.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm using 2014.03, not the dev version. Is this not possible with the stable version? I am using difference(), so I'm not sure what you mean by "try difference()". I did have a typo in my original email, I meant to include the parens. To keep it simple, I excluded the transformations. The full code is: use <Write.scad> difference() { translate([-1, -1, -1]) { cube(6); } translate([0, 0, -3]) { scale([1.5, 1, 10]){ write("N"); }} } Commenting out the difference shows an N stretching out of the top of a cube. On Fri, Dec 26, 2014 at 1:09 AM, MichaelAtOz [via OpenSCAD] < ml-node+s1091067n10726h15@n5.nabble.com> wrote: > BTW if you are using the dev snapshot see text() > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text>. It is 2D, if > you want to use it for 3D you need to linear_extrude() it. > > > Unless specifically shown otherwise above, my contribution is in the > Public Domain; To the extent possible under law, I have waived all > copyright and related or neighbouring rights to this work. This work is > published globally via the internet. :) > Inclusion of works of previous authors is not included in the above. > The *TPP* is no simple *“trade agreement.”* *Fight it!* > http://www.ourfairdeal.org/ > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10726.html > To unsubscribe from How to difference shape with text?, click here > <http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=10724&code=Y2hyaXNzcGVuQGdtYWlsLmNvbXwxMDcyNHwxMjg4NzkwNjM4> > . > NAML > <http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10727.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Dec 26, 2014 6:21 AM

That works for me on 2014.03 (W7/64).

http://forum.openscad.org/file/n10728/write.jpg
(I have the '!' as I had ther code in the editor too)

What is it doing for you?


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10728.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

That works for me on 2014.03 (W7/64). <http://forum.openscad.org/file/n10728/write.jpg> (I have the '!' as I had ther code in the editor too) What is it doing for you? ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-difference-shape-with-text-tp10724p10728.html Sent from the OpenSCAD mailing list archive at Nabble.com.