Hello,
I would like to contribute by adding a couple of features to improve the workflow:
Automated Cutting Direction:
Currently, the cutting direction (clockwise/anticlockwise) has to be set manually. I propose a feature that automatically sets the cutting direction based on part geometry:
Shape Movement in the Interface:
Users currently need to manually edit the DXF file to move shapes around. I would like to add functionality that allows users to visually move shapes within the interface itself, making it more intuitive to rearrange parts.
Any feedback or guidance on these ideas would be greatly appreciated, especially regarding their feasibility within the current codebase. I’m looking forward to contributing to the project!
Best regards,
Patrick
Hi Patrick,
1.) Automated Cutting Direction:
right now the cutting direction can be set automatically in CW direction for closed shapes (I think thats standard). Making this a selectable option shouldn't be that hard. Here you find the interesting Code for that.
algorithm:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/shape.py#l128
Setting the direction:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/shape.py#l170
2.) Shape Movement in the interface:
this is a bit harder but the code also provides a good starting point. All shapes are scaled / moved / rotatet based on their parentEntity while they are created.
Shape:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/shape.py#l63
Create Shape:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode.py#l934
Which means this needs be changed for each shape individually which is moved around.
The most difficult might be doing this in the Canvas via drag and drop, this needs to be done somewhere in both or just in one of 2D or 3D see links:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/gui/canvas2d.py#l77
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/gui/canvas3d.py#l196
regards
Christian
Hi Patrick, do you need more input. Didn't get any feedback here up to now ...
Hi Christian. Thank you for your guidance. I am ok for now, making steady progress.
Thanks for the update. Just let me know if you need any guidance.
hi christian, what is the purpose of the absolute geometry. I see it used, i understand how it is used but I dont know why
Hi Patrick, it's just a way of implementation which was used for adding
the start / stop moves to scaled or rotated inserts. Could be done
different, but it did grow in this direction.
Regards Christian
Patrick Bagnall pkbagnall@users.sourceforge.net schrieb am Di., 1. Apr.
2025, 17:31:
Related
Tickets: #166
The breaks are an interrupt in the contour. It's calculating the
intersections to the break layer and removes parts of the lines which are
interesting with the geometry on the break layer.
Didn't look at it in details, but that's my fast guess
chrisko christi_ko@users.sourceforge.net schrieb am Di., 1. Apr. 2025,
19:21:
Related
Tickets: #166
More specifically this line in shape.py line line 434. new_geos = PostPro.breaks.getNewGeos(new_geos). I dont understand what it is doing as the correct geos are already stored in new_geos
Hey chris. I hope you are well. I have gotten it to a point where it seems to work quite well. Now, if you move the shapes in the interface the outputted gcode as well as the displayed optimized routes change accordingly. left to do is to make it so that when you select a shape, if it has any, the hole shapes that are part of it will be automatically selected too. I would like some advice on how to do this if you wouldnt mind. Also if you are open to it I would like to show you what I've written before I fully test it so you can tell me if there is any obvious problem or if its absolute garbage etc. lol
Hi Patrick,
I'm fine, thanks for asking. If you want to share your code and want me to take a look into it, you can create a fork and send me a link, or i can also give you developers right's for the project and you can create a branch to work on. Whatever you prefer, but i think the best way would be to grant you developers rights.
Now to the 2nd question. If you want to move hole shapes which are in a shape, i think there is not easy way to it. You need to check if there are inside a other shape and also select them for moving. Is your code capable of moving multiple parts at once, if you for example select 2 or more shapes?
regards
Christian
Yes that would be great thank you. Yes the code moves multiple parts at once. I also think i have found a good way of checking if a shape is in another shape if we can assume no shapes intersect upon opening the file.
Pat