We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Is there a way to export points to DXF using the DXF library. From what I have attempted, read, and seen this cannot be done. It appears DXF export only works for lines, arcs, and 3D shapes but not points. If this is the case, could this feature (exporting points to DXF) please be implemented?
Answers
use a triangle where x, y, z for all 3 vertices is the same.
or a line from x, y, z to x, y, z
Is your goal to create the appearance of a point?
Or is your goal to create a DXF POINT entity in the file as per the DXF specification, e.g. for reference?
http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf#page131
(i read that earlier today but it wasn't clear whether the DXF POINT entity (or the VERTEX on p149) could exist on its own or whether it was something that just defined part of a larger entity)
(certainly if you try the dxf code on the library page with only a point in it, it gives you an error (one which is a bit cryptic:
"RawDXF can only be used with beginRaw(), because it only supports lines and triangles"
but i think you're right and that's probably more a library deficiency than the file format not supporting it))
with a line from 0, 0 to 0, 0 i get
but i haven't tried decoded that yet
(ok, added // comments above. the canvas is 500x500 and i'm drawing at 0, 0. it's using the centre as the origin so my point is -250, -250. no idea about the z...)
@koogs @jeremydouglass
The goal is to create a single DXF POINT. The DXF point created as an output of the processing sketch will then be sent to a laser. My concern with making a line using the same two points is that I cannot have any points duplicated as it increases the runtime for the laser on an already long process.
If this is a library deficiency, I would really appreciate if it could be updated to allow the export of DXF POINT entities.
https://github.com/processing/processing/blob/master/java/libraries/dxf/src/processing/dxf/RawDXF.java
looks clear enough
Right. Maybe something like:
void writePoint(){}
writePoint()
A key question is what to do at 324 given a condition for POINT given that
createShape()
only supports "ELLIPSE, RECT, ARC, TRIANGLE, SPHERE, BOX, QUAD, or LINE". - https://processing.org/reference/createShape_.html as per @koogs belowYou need to figure out how you are encoding points alongside triangles etc. in Processing before you translate them into DXF. A demo sketch would really help.
@koogs @jeremydouglass Thank you guys for the help. Writing or modifying a library is above my skill level in processing. I'm an ME so while enjoy programming side quite a bit I would need some help with modifying the library.
I have a processing sketch right now which takes a .txt file and extracts data from the file for conversion to .csv. I then copy the data from the .csv and plot a couple thousand points into AutoCAD. What I'm trying to do is skip the intermediary .csv and plot the data straight to a dxf.
the PShape javadoc says that POINTS are ok too, so i tried it
looks ok.
Is there something I'm missing here? The dxf is empty when I attempt the export.
Go back edit your post
format your code better
can you provide a sample tsv file, just a short one...
the library still doesn't support POINTS, i was just pointing out to jeremy that the limitation wasn't PShape, even though the reference suggests that PShape doesn't do points.
did you see an error when you ran your code?
@koogs @jeremydouglass I did not see any error code when running the code.
Please see the sample data below.
@koogs Hey Koogs. Any update on whether the library could be updated to allow support for plotting points to a dxf?