We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
text in dxf (Read 1242 times)
text in dxf
Aug 1st, 2007, 9:12pm
 
Hi there,
Just wondering if it's possible to export text to dxf. I'm just getting blocks in my dxf when using the "words" example.
Thanks,
Chris
Re: text in dxf
Reply #1 - Aug 1st, 2007, 10:22pm
 
If you mean text outlines try the creatFont() method of using a font. it retains the font as lines instead of using textures. works like a charm on pdf's should do the trick on a dxf.

http://www.processing.org/reference/createFont_.html
Re: text in dxf
Reply #2 - Aug 1st, 2007, 11:53pm
 
Thanks for that, but I still get the same results... just blocks in the dxf.

Here's the code I am using, if you might have any other suggestions.
Thanks again,
Chris


/**
* Words.
*
* The text() function is used for writing words to the screen.
*
* Created 15 January 2003
*/
import processing.dxf.*;

void setup() {
 size(200, 200, P3D);
 // Uncomment the following two lines to see the available fonts
 String[] fontList = PFont.list();
 println(fontList);

}



void draw() {
 if (mousePressed) {
   beginRaw(DXF, "output.dxf");
 }

PFont myFont = createFont("Arial", 32);
textFont(myFont);

fill(0);
text("12345", 0, 60);
text("67890", 0, 95);

 if (mousePressed) {
   endRaw();
 }
}
Re: text in dxf
Reply #3 - Aug 2nd, 2007, 3:22am
 
try calling textMode(SHAPE) after textFont().
Re: text in dxf
Reply #4 - Aug 2nd, 2007, 4:53am
 
it seems that textMode(SHAPE) isn't supported with anything other than OpenGL. I am able to get some output using opengl, but it outputs a mesh and it's a messy mesh. Also, noticed that the origin point for any of the output isn't anywhere remotely close to a 0,0,0 which I'd kind of expect, and the output I get is flipped upside down. Anyhow, any other ideas?
Thanks,
Chris
Re: text in dxf
Reply #5 - Aug 5th, 2007, 8:10pm
 
that's correct. text glyph shapes are complicated and produce a mesh when drawn in 3D. begin/endRaw() only record triangles, so you're gonna get a triangle mesh. opengl is the only renderer that supports textMode(SHAPE) because the tesselation is very tricky with type (interior and exterior shapes, e.g. the hole in the middle of a letter O).

regarding origin points, read about the coordinate system in help -> getting started.

the dxf library is very basic, so the results you see in the file are largely dependent on the software you're using to read the dxf.
Re: text in dxf
Reply #6 - Aug 5th, 2007, 10:08pm
 
Thanks for the explanation.
Maybe I should be asking a different question.

Is it possible to export vector based text outlines, in any format, from processing?

Thanks

BTW Kudos to you on processing... very cool stuff, thanks for sharing it with the rest of the world.
Page Index Toggle Pages: 1