Menu

#254 Dxf-g converter improvment

Incomplete
open
nobody
None
5
2014-01-19
2014-01-19
huskmate13
No

I attach the modifications (in the form of patch/new file) i did to improve the dxf to g converter. I append a dxf file for test too were you can see the problem. What did i do?

1) Basically i noticed that all 2d entities (line, arc, circles) present in a layer were converted into a sketch using the function nmg_wire_edges_to_sketch(). This to my advice is conceptually wrong since this imply flatting down all Z coordinates. You can't put several entities potentially laying on different planes into one single sketch. That's why if (layers[i]->m) i simply call the mk_nmg() function that create an nmg model preserving all the planes and coordinates.

2) I modified the functions process_circle_entities_code(int code) and process_arc_entities_code(int code).
In the first function i enabled the use of extrusion vector (dxf codes 210,220,230). I decided to transform arc and circles in sketches rather than polylines inside an nmg model. This because this way let me preserve the information of what kind of entity it originally was.

3) At the end of the loop when it put together all the entities of a single layer i put to zero the flag of the mk_comb() function, so rather than creating a region it creates a comb. This is the line of code i changed:
if (mk_comb(out_fp, bu_vls_addr(&comb_name), &head, 0, NULL, NULL,
In my opinion there is no reason to create a region of all the entities present on a layer (there may even be 2d primitives), all the entities have to remain the way they are and not combined with boolean operations to form a region. It is correct to combine them together to form a Comb hence i changed the flag in the mk_comb() call.

1 Attachments

Discussion


Log in to post a comment.

Monday.com Logo