Hi Andrew and Husky.
So, I can make the clip by rectangle work, manually. But am completely lost trying to script this.
Suppose I start with a sectioned circle 816-test-1-9.dxf
The first step is to explode it into components (816a).
I then trim it, creating something like this: 816b (First snag: the idea of trimming it is to trim it into two parts A = A' + A''
How do you make the trim occur in exactly the same point?)
I tried to automatically close the poly line, but couldn't figure out how to make that work. So I ended up snapping to the end of the line and drawing a line.
So that creates A'. Need to create the complement A" Thanks in advance for thoughts.
DXF tiling II
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Junior Member
- Posts: 19
- Joined: Fri May 21, 2021 11:42 pm
DXF tiling II
- Attachments
-
- 816c.dxf
- (101.44 KiB) Downloaded 405 times
-
- 816b.dxf
- (100.9 KiB) Downloaded 392 times
-
- 816a.dxf
- (101.45 KiB) Downloaded 403 times
-
- 816-test-1-9.dxf
- (4.08 KiB) Downloaded 423 times
Re: DXF tiling II
It's not entirely clear to me if you are trying to create a script (i.e. a program in JavaScript) that does that or if your question is something else. Thanks for your clarification.
-
- Junior Member
- Posts: 19
- Joined: Fri May 21, 2021 11:42 pm
Re: DXF tiling II
Yes, the primary question is:
a) how to accomplish this programatically so the same process could occur on different dxf's.
In the process, I have several sub problems that I have identified.
1. DXFS do not seem to import with a consistent coordinate system. I'm sure this is an artifact of how they are created,but I'm not sure how to deal with it.
2. How to trim A into two parts A' and A''.
3. How to close the segments and save A' & A''.
a) how to accomplish this programatically so the same process could occur on different dxf's.
In the process, I have several sub problems that I have identified.
1. DXFS do not seem to import with a consistent coordinate system. I'm sure this is an artifact of how they are created,but I'm not sure how to deal with it.
2. How to trim A into two parts A' and A''.
3. How to close the segments and save A' & A''.
-
- Junior Member
- Posts: 19
- Joined: Fri May 21, 2021 11:42 pm
Re: DXF tiling II
Conceptually the intent is to have a script
Slicedxf Name Xslice, Yslice
For i = 0 to {NameXExtentents/Xslice}
for j = 0 to {NameYExtents/Yslice}
Clip to Rectangle {(0,0),(i*Xslice,j*Yslice)}
Close Open Segments
Save Nameij
Next j
Next I
IE: If you have a table of size X,Y, and a dwg that exceeds the size of the table, you could slice the dwg into tiles.
Slicedxf Name Xslice, Yslice
For i = 0 to {NameXExtentents/Xslice}
for j = 0 to {NameYExtents/Yslice}
Clip to Rectangle {(0,0),(i*Xslice,j*Yslice)}
Close Open Segments
Save Nameij
Next j
Next I
IE: If you have a table of size X,Y, and a dwg that exceeds the size of the table, you could slice the dwg into tiles.
Re: DXF tiling II
Hi,
I have the same problem as Andrew to grasp what the goal is.
What is the reason that the vertical lines in 816a-b-c are doubled up?
Did you mean shifted up?
'Clip to Rectangle' has also a 'Cut at Area Boundary' mode.
Cutting would cut crossing entities in two at exactly the same spot given Floating Point uncertainties.
The coordinate numbers will be correct up to about 15.95 significant digits disregarding the exponent.
Floating Point uncertainties for arcs may be somewhat larger, still very minute.
The major problem with 816c will be:
What to consider as a shape that needs closing?
Humans are good at recognizing where to draw those closing segments.
The three 'shapes' as we see them were not closed entities to start with.
Regards,
CVH
I have the same problem as Andrew to grasp what the goal is.
What is the reason that the vertical lines in 816a-b-c are doubled up?
816-test-1-9.dxf were already 3 separate 'shapes'.chrispedersen wrote: ↑Tue Jul 27, 2021 9:14 pmThe first step is to explode it into components (816a).
Did you mean shifted up?
That is the difference between trimming and cutting.chrispedersen wrote: ↑Tue Jul 27, 2021 9:14 pmI then trim it, creating something like this: 816b (First snag: the idea of trimming it is to trim it into two parts A = A' + A''
How do you make the trim occur in exactly the same point?)
'Clip to Rectangle' has also a 'Cut at Area Boundary' mode.
Cutting would cut crossing entities in two at exactly the same spot given Floating Point uncertainties.
The coordinate numbers will be correct up to about 15.95 significant digits disregarding the exponent.
Floating Point uncertainties for arcs may be somewhat larger, still very minute.
The major problem with 816c will be:
What to consider as a shape that needs closing?
Humans are good at recognizing where to draw those closing segments.
The three 'shapes' as we see them were not closed entities to start with.
Regards,
CVH
Last edited by CVH on Wed Jul 28, 2021 8:30 am, edited 4 times in total.
Re: DXF tiling II
Could you explain that phrase in more detail ...?chrispedersen wrote: ↑Tue Jul 27, 2021 10:32 pm1. DXFS do not seem to import with a consistent coordinate system.
Got me curious
Regards,
CVH
-
- Junior Member
- Posts: 19
- Joined: Fri May 21, 2021 11:42 pm
Re: DXF tiling II
CVH wrote: ↑Wed Jul 28, 2021 6:39 amCould you explain that phrase in more detail ...?chrispedersen wrote: ↑Tue Jul 27, 2021 10:32 pm1. DXFS do not seem to import with a consistent coordinate system.
Got me curious
Regards,
CVH
I'm generating DXFs programmatically, and there seems to be some inconsistency. All the programs are intended to have a small offset from (0,0) And then generate +x,+y.
"Why the double lines" - Mostly so the sections can be easily grabbed and moved.
Logically, before the trim, if a the trim is "inside" the shape I want to create an edge.