Eg put text on the cylinder surface, how can i call it, projection? shadow?
Of course we need transform the flat sharp into a curved one. I want put
many characters on the cylinder.
http://forum.openscad.org/file/n20182/test.png
--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
What kind of curved surface? If the curve is defined by a formula, I have a
possible solution. Search thingiverse for "openscad curved surface "
On 21/01/2017 9:04 PM, "eexpss" eexpss@139.com wrote:
Eg put text on the cylinder surface, how can i call it, projection? shadow?
Of course we need transform the flat sharp into a curved one. I want put
many characters on the cylinder.
http://forum.openscad.org/file/n20182/test.png
--
View this message in context: http://forum.openscad.org/It-
seems-no-way-to-put-text-on-the-curved-surface-tp20182.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
There's this quite old thingiverse thing, Write.scad:
https://www.thingiverse.com/thing:16193
But it's limited to using text supplied in a dxf file, rather than using
built in fonts.
I also found this update: https://github.com/brodykenrick/text_on_OpenSCAD
Which is based on Write.scad but uses 'text ()'. Seems a bit complicated,
though!
I had a quick go at this, by slicing the text, then rotating the slices:
======
radius = 15;
height = 30;
slices = 20;
txt = "OpenSCAD";
text_depth = 2;
circumference = 2 * 3.14159 * radius;
slice_width = circumference / slices;
circular_text ();
module circular_text () {
union () {
for (i = [0:1:slices]) {
rotate ([0,0,i*(360/slices)]) translate ([0,-radius,0])
intersection () {
translate ([-slice_width/2 - (i*slice_width) ,0 ,0]) rotate
([90,0,0])
linear_extrude(text_depth, center = true, convexity = 10)
text(txt);
cube ([slice_width+0.1, text_depth+0.1, height], true);
}
}
}
}
======
This works pretty well, though if you increase the number of 'slices' to
improve the steps in the text, it takes a long time to draw/render! See the
OpenSCAD user manual for using 'text', to change size/font etc:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text
http://forum.openscad.org/file/n20185/text_on_cylinder.png
However, if I try to difference this from the cylinder, I get 'WARNING:
Normalized tree is growing past 10000 elements. Aborting normalization."
To get around this, I export the text as an stl, then reimport and
difference that from the cylinder:
======
difference () {
cylinder (r=radius, h=height, center=true);
import("text.stl", convexity=10);
}
======
http://forum.openscad.org/file/n20185/text_on_cylinder_2.png
I'm sure there are other ways of doing this, and it's probably been gone
over loads of times in the forum, but this seems a pretty straightforward to
me. You could even slice the words horizontally as well as vertically, and
map it onto a sphere.
Ian S.
--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20185.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
slicing the text using intersection() may be better. It seems more general
purpose and flexible. Sometimes maybe I need deal with a vertical text.
thanks all.
--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20187.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
See:
http://forum.openscad.org/textCylinder-dodgy-version-for-text-around-a-cylinder-td9262.html#a9265
Admin - PM me if you need anything, or if I've done something stupid...
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. Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20188.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
---======
include <size.def>;
font="经典繁毛楷,fan-maokai:style=Regular,maokai";
fsize=4;
text_depth = 2;
vspace=fsize*1.4;//不精确的数据, 手动调整测量
text_height=3;//不精确的数据, 手动调整测量
module char(unichar){
rotate([90,0,0])linear_extrude(text_depth)text(text=unichar,font=font,size=fsize);
}
module vtext(){
union(){
translate([0,0,vspace/23-text_height/2])char("御风而行");
translate([0,0,vspace/2-text_height/2])char("风");
translate([0,0,-vspace/2-text_height/2])char("而");
translate([0,0,-vspace/23-text_height/2])char("行");
}
//echo(len("御"));//1
}
radius = OR-text_depth/4;
height = h;
slices = 30;
//vtext();cube([22,1,8]);
string_width=22;//不精确的数据, 手动调整测量
actual_angle=360string_width/(23.14159*radius);
slice_width=string_width/slices;
module circular_text(){
union(){
for(i=[0:1:slices]){
rotate ([0,0,i*(actual_angle/slices)]) translate ([0,-radius,0])
intersection(){
translate([-slice_width/2-(i*slice_width),0,0])children();
cube([slice_width+0.1,text_depth+0.1,height],true);
}
}
}
}
//difference(){
#cylinder(height,r=OR,center=true);
circular_text()vtext();
//}
---=========
http://forum.openscad.org/file/n20189/2017-01-22_13-12-01%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png
looks better. I found few problem:
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Compiling highlights (1 CSG Trees)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Normalized CSG tree has 151 elements
Compile and preview finished.
--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20189.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
eexpss wrote
I found few problem:
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Compiling highlights (1 CSG Trees)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Normalized CSG tree has 151 elements
Compile and preview finished.
Admin - PM me if you need anything, or if I've done something stupid...
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. Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20190.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
My script DOES use intersection. Also, I had the same warnings. To get around
those, I rendered the text on it's own, exported it as stl, then reimported
it to difference from the cylinder. That works will.
Ian
--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20191.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On 21. jan. 2017 09:03, eexpss wrote:
Eg put text on the cylinder surface, how can i call it, projection? shadow?
Of course we need transform the flat sharp into a curved one. I want put
many characters on the cylinder.
I wouldn't know how to do it in OpenSCAD, as transforming what is
originally 3d text protruding from a flat surface cannot be expressed as
a standard transformation, which limits itself to rigid body
transformations. Maybe, with such limitations, the best you can do is
isolating the letters and transform each of them.
I've experimented with this type of issue, by modifying polyhedron
coordinates directly http://www.thingiverse.com/thing:2054654
With OpenSCAD I think you would need to export the 3d text as STL and
transform the coordinates yourself, then import back. But there is also
the issue that the letters themselves become non-flat, requiring a
different tessellation than the original would normally have.
Carsten Arnholm
Wrap image on curved surface for OpenSCAD found on #Thingiverse
https://www.thingiverse.com/thing:1668883
On 21/01/2017 21:04, "eexpss" eexpss@139.com wrote:
Eg put text on the cylinder surface, how can i call it, projection? shadow?
Of course we need transform the flat sharp into a curved one. I want put
many characters on the cylinder.
http://forum.openscad.org/file/n20182/test.png
--
View this message in context: http://forum.openscad.org/It-
seems-no-way-to-put-text-on-the-curved-surface-tp20182.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org