discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

It seems no way to put text on the curved surface?

E
eexpss
Mon, Jan 23, 2017 3:17 AM

according to MichaelAtOz' suggest.
follow http://forum.openscad.org/file/n9262/textManipulation.scad

I add this module: rotate text and cut.

module rotate_cut_text(){
union(){for(i=[0:1:slices]){
intersection(){

rotate([0,0,istep_angle+step_angle/2])translate([-islice_width,-radius,0])children();
rotate([0,0,-90+istep_angle])rotate_extrude(angle=step_angle)
translate([radius,0])square([text_height
2,height],true);}
}}
}

rotate_cut_text()vtext();

http://forum.openscad.org/file/n20197/2017-01-23_11-14-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png

the result slices is more continuous.
http://forum.openscad.org/file/n20197/2017-01-23_11-16-00%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png

--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20197.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

according to MichaelAtOz' suggest. follow http://forum.openscad.org/file/n9262/textManipulation.scad I add this module: rotate text and cut. ================= module rotate_cut_text(){ union(){for(i=[0:1:slices]){ intersection(){ rotate([0,0,i*step_angle+step_angle/2])translate([-i*slice_width,-radius,0])children(); rotate([0,0,-90+i*step_angle])rotate_extrude(angle=step_angle) translate([radius,0])square([text_height*2,height],true);} }} } rotate_cut_text()vtext(); =================== <http://forum.openscad.org/file/n20197/2017-01-23_11-14-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png> the result slices is more continuous. <http://forum.openscad.org/file/n20197/2017-01-23_11-16-00%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png> -- View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20197.html Sent from the OpenSCAD mailing list archive at Nabble.com.
E
eexpss
Mon, Jan 23, 2017 3:39 PM

MichaelAtOz wrote

  1. If you mean size of text(). Yes, makes life difficult.

I found out.

str_width=len(str)(fsize1.36);
str_height=fsize*1.25;

almost accuracy, of course I only test chinese unicode font.

http://forum.openscad.org/file/n20199/2017-01-23_23-39-26%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png

--
View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20199.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

MichaelAtOz wrote > 1. If you mean size of text(). Yes, makes life difficult. I found out. ====================== str_width=len(str)*(fsize*1.36); str_height=fsize*1.25; ======================= almost accuracy, of course I only test chinese unicode font. <http://forum.openscad.org/file/n20199/2017-01-23_23-39-26%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png> -- View this message in context: http://forum.openscad.org/It-seems-no-way-to-put-text-on-the-curved-surface-tp20182p20199.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Mon, Jan 23, 2017 5:07 PM

Another very general approach is discussed in
http://forum.openscad.org/Wrapping-text-around-a-complex-geometry-td18145.html.
It requires saving the OpenSCAD text in AMF format, processing it with a
Python program and feeding its output to an OpenSCAD program that maps the
text on the target surface.

Em 23 de jan de 2017 13:40, "eexpss" eexpss@139.com escreveu:

MichaelAtOz wrote

  1. If you mean size of text(). Yes, makes life difficult.

I found out.

str_width=len(str)(fsize1.36);
str_height=fsize*1.25;

almost accuracy, of course I only test chinese unicode font.

<http://forum.openscad.org/file/n20199/2017-01-23_23-39-
26%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png>

--
View this message in context: http://forum.openscad.org/It-
seems-no-way-to-put-text-on-the-curved-surface-tp20182p20199.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

Another very general approach is discussed in http://forum.openscad.org/Wrapping-text-around-a-complex-geometry-td18145.html. It requires saving the OpenSCAD text in AMF format, processing it with a Python program and feeding its output to an OpenSCAD program that maps the text on the target surface. Em 23 de jan de 2017 13:40, "eexpss" <eexpss@139.com> escreveu: > MichaelAtOz wrote > > 1. If you mean size of text(). Yes, makes life difficult. > > I found out. > ====================== > str_width=len(str)*(fsize*1.36); > str_height=fsize*1.25; > ======================= > > almost accuracy, of course I only test chinese unicode font. > > <http://forum.openscad.org/file/n20199/2017-01-23_23-39- > 26%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png> > > > > -- > View this message in context: http://forum.openscad.org/It- > seems-no-way-to-put-text-on-the-curved-surface-tp20182p20199.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 >