QCAD3.28.2 explode function problem

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

QCAD3.28.2 explode function problem

Post by WildWolfCJ » Thu Oct 26, 2023 7:24 am

Hi all!
QCAD3.28.2 WINDOWS10
I have purchased the professional version of QCAD. I am now working on the exposure function of the electron beam lithography machine. The upper computer needs to transfer the coordinates to the lower computer. I want to obtain the text in the DXF file at a certain distance step value (such as 0.1 micron). Coordinates, my idea is to first use QCAD to convert the text into polyline, and then obtain the coordinates based on the closed polyline. I now encounter several problems
1 Figure 1 is the text displayed in AUTOCAD2020. Figure 2 is the graphic displayed in my own software after using explode. Why does the red arrow exceed the distance?
2 How can I get the polyline of each text, such as the polyline array corresponding to the word
Is my idea correct? Can you give me a better idea for getting the coordinates?
Attachments
VeryCapture_20231026141729.jpg
VeryCapture_20231026141729.jpg (275.87 KiB) Viewed 11499 times
VeryCapture_20231026140326.jpg
VeryCapture_20231026140326.jpg (240.86 KiB) Viewed 11499 times
Last edited by WildWolfCJ on Fri Oct 27, 2023 8:04 am, edited 1 time in total.

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD3.28.2 explode function problem

Post by CVH » Thu Oct 26, 2023 8:39 am

WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
Why does the red arrow exceed the distance?
Please provide example files, an original and the exploded version.
Probably you need to specify and/or include the used font file of both systems. :wink:
WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
2 How can I get the polyline of each text,
A polyline is a line art, a string of segments, lines and/or arcs. Poly aka more & various line segments.
A polyline can be closed or open, meaning that the end segment connects to the begin segment or not.
Closed can be logically or geometrically. The first is reported as closed, the second as open.

One glyph can be exploded to a number of closed polylines.
These form the outer contours of the details of the glyph.
After explosion there is no further relation to the glyph's, the words or the text they resemble.

There is nothing as a polyline array.
On script level we could create an array with a number of RPolyline shapes.
I don't think that the 'lower computer' can do something with the QCAD native RPolyline shapes in a JS array.
A polyline is defined by vertices, one for each Node position in XYZ + Bulge factor + Start and end width.
The bulge factor defines the curve of the upcoming segment.

Polylines of text can be exploded one level further what returns line and or arc segments.
All unrelated line-art entities.

On script level:
For polyline entities refer to: https://qcad.org/doc/qcad/3.0/developer ... ntity.html
And the related data object: https://qcad.org/doc/qcad/3.0/developer ... _data.html
For polyline shapes refer to: https://qcad.org/doc/qcad/3.0/developer ... yline.html
And similar for lines and arcs.
WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
Can you give me a better idea for getting the coordinates?
All depends in what format the 'lower computer' requires the data.
For example in CSV format or a dedicated format or more general as G-code ...

QCAD/CAM can export G-code and can be customized for individual G-code dialects.
But usually, computers associated with cnc machines can interpret dxf directly these days.
All depends if there is a CAM engine included.

Regards,
CVH

WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

Re: QCAD3.28.2 explode function problem

Post by WildWolfCJ » Fri Oct 27, 2023 7:12 am

CVH wrote:
Thu Oct 26, 2023 8:39 am
WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
Why does the red arrow exceed the distance?
Please provide example files, an original and the exploded version.
Probably you need to specify and/or include the used font file of both systems. :wink:
WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
2 How can I get the polyline of each text,
A polyline is a line art, a string of segments, lines and/or arcs. Poly aka more & various line segments.
A polyline can be closed or open, meaning that the end segment connects to the begin segment or not.
Closed can be logically or geometrically. The first is reported as closed, the second as open.

One glyph can be exploded to a number of closed polylines.
These form the outer contours of the details of the glyph.
After explosion there is no further relation to the glyph's, the words or the text they resemble.

There is nothing as a polyline array.
On script level we could create an array with a number of RPolyline shapes.
I don't think that the 'lower computer' can do something with the QCAD native RPolyline shapes in a JS array.
A polyline is defined by vertices, one for each Node position in XYZ + Bulge factor + Start and end width.
The bulge factor defines the curve of the upcoming segment.

Polylines of text can be exploded one level further what returns line and or arc segments.
All unrelated line-art entities.

On script level:
For polyline entities refer to: https://qcad.org/doc/qcad/3.0/developer ... ntity.html
And the related data object: https://qcad.org/doc/qcad/3.0/developer ... _data.html
For polyline shapes refer to: https://qcad.org/doc/qcad/3.0/developer ... yline.html
And similar for lines and arcs.
WildWolfCJ wrote:
Thu Oct 26, 2023 7:24 am
Can you give me a better idea for getting the coordinates?
All depends in what format the 'lower computer' requires the data.
For example in CSV format or a dedicated format or more general as G-code ...

QCAD/CAM can export G-code and can be customized for individual G-code dialects.
But usually, computers associated with cnc machines can interpret dxf directly these days.
All depends if there is a CAM engine included.

Regards,
CVH
HI CVH
Attached are the DXF source file and the exploded DXF file. I use the command line method to execute the explosion function

I have another question. After I explode the text, how do I get the polyline corresponding to the text? For example, a piece of text "ABC", how do I get the polyline corresponding to A B C?

To ask a question, can the rectangular coordinates of each text entity be obtained through the command line? For example, the text "ABC" corresponds to (top, left, right, bottom) and "GHD" corresponds to ((top1, left1, right1, bottom1))
Attachments
Drawing1 - 副本 (2)_explode.dxf
(453.07 KiB) Downloaded 529 times
Drawing1 - 副本 (2).dxf
(212.91 KiB) Downloaded 547 times

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD3.28.2 explode function problem

Post by CVH » Fri Oct 27, 2023 8:30 am

In Drawing1.dxf (I can't include the non-latin text :wink: )
The top text is in Arial and that is a system font on my win OS.
The bottom text is Rich Text formatted by this string: fSimSun|b1|i0|c134|p2
A: SimSun.ttf is not on my system and substituted by a look alike.
B: c134 reverts to c0 and p2 reverts to p0 when edited under QCAD.

Because QCAD renders the lower text with a substitute it may or not match the boundary and it doesn't in my case.
Always ensure that you have the font installed that are used in a drawing.
The main reason why I asked to attach the used font files. :wink:
Even then it may that QCAD ... Qt renders it a bit different than in the source application.
WildWolfCJ wrote:
Fri Oct 27, 2023 7:12 am
For example, a piece of text "ABC", how do I get the polyline corresponding to A B C?
Given your preference for Explode is to explode text glyphs to polylines (See App.Preffs. .. Modify .. Explode)
Then a text 'ABC' in Arial would explode to 6 unrelated polylines as explained above.
The A has one and the B has two extra inner paths beside the outer path, the C can be formed in one singular outer path.

In your drawing one glyph may even explode in up to 8 closed outlines as polylines.
Once exploded it is reduced to merely line-art that may still resemble the text for us humans.
These polylines are not related to each other and may be treated individually like any other polyline entity.

Botton line: There is no singular polyline associated with every glyph.
There is no 'polyline corresponding to A B C'
(Apart from that of the C in the Arial example :wink: )

May I also remark that Arial set to bold is not the same as Arial Bold.
Arial set to bold or set italic is a mathematical thing that may include glitches, self-crossing polylines and/or other artifacts.
QCAD does not use the Bold or Italic sub typeface even if available in the font file.
Essentially, the text is less to more distorted.
CAM that can pocket fill closed boundary paths may struggle with this.


Hint: One can select only a portion of text in another post or reply before hitting the Quote button. :wink:

Regards,
CVH
Last edited by CVH on Fri Oct 27, 2023 9:50 am, edited 6 times in total.

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD3.28.2 explode function problem

Post by CVH » Fri Oct 27, 2023 9:24 am

WildWolfCJ wrote:
Fri Oct 27, 2023 7:12 am
To ask a question, can the rectangular coordinates of each text entity be obtained through the command line? For example, the text "ABC" corresponds to (top, left, right, bottom) and "GHD" corresponds to ((top1, left1, right1, bottom1))
Please read the above forum rules in red.
One question per topic.

Not directly. dwg2csv may export a csv with text entities, their text and the insertion position.
bbox acts on the entire drawing and that would fit if there is nothing but only one text entity.
But remark that a bounding box is a straight up box where the sides are horizontal or vertical.
And that polylines from an explosion of text are no longer text entities.

With a custom script or a custom Command Line script one could filter on text entities ...
... clone them to set the angle to zero and export the sizes of the 'real' bounding boxes.
The corners coordinates of original slanted text boxes can also be obtained by simple polar math.
And a more sophisticated script could export whatever details required about exploded text.

A very basic example of a custom Command Line script can be found here:
https://www.ribbonsoft.com/en/tutorial- ... ol-scripts

Regards,
CVH

WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

Re: QCAD3.28.2 explode function problem

Post by WildWolfCJ » Sat Oct 28, 2023 6:30 am

CVH wrote:
Fri Oct 27, 2023 8:30 am
In Drawing1.dxf (I can't include the non-latin text :wink: )
The top text is in Arial and that is a system font on my win OS.
The bottom text is Rich Text formatted by this string: fSimSun|b1|i0|c134|p2
A: SimSun.ttf is not on my system and substituted by a look alike.
B: c134 reverts to c0 and p2 reverts to p0 when edited under QCAD.

Because QCAD renders the lower text with a substitute it may or not match the boundary and it doesn't in my case.
Always ensure that you have the font installed that are used in a drawing.
The main reason why I asked to attach the used font files. :wink:
Even then it may that QCAD ... Qt renders it a bit different than in the source application.
WildWolfCJ wrote:
Fri Oct 27, 2023 7:12 am
For example, a piece of text "ABC", how do I get the polyline corresponding to A B C?
Given your preference for Explode is to explode text glyphs to polylines (See App.Preffs. .. Modify .. Explode)
Then a text 'ABC' in Arial would explode to 6 unrelated polylines as explained above.
The A has one and the B has two extra inner paths beside the outer path, the C can be formed in one singular outer path.

In your drawing one glyph may even explode in up to 8 closed outlines as polylines.
Once exploded it is reduced to merely line-art that may still resemble the text for us humans.
These polylines are not related to each other and may be treated individually like any other polyline entity.

Botton line: There is no singular polyline associated with every glyph.
There is no 'polyline corresponding to A B C'
(Apart from that of the C in the Arial example :wink: )

May I also remark that Arial set to bold is not the same as Arial Bold.
Arial set to bold or set italic is a mathematical thing that may include glitches, self-crossing polylines and/or other artifacts.
QCAD does not use the Bold or Italic sub typeface even if available in the font file.
Essentially, the text is less to more distorted.
CAM that can pocket fill closed boundary paths may struggle with this.


Hint: One can select only a portion of text in another post or reply before hitting the Quote button. :wink:

Regards,
CVH
HI CVH
Do you mean that AUTOCAD uses the SimSun.tff font but QCAD does not use this font? I think this possibility can be ruled out because I have tried different fonts. The outline and font are very similar after QCAD explosion. The results I get by using the explosion function in autocad are different from the explosion function I get by using QCAD. Attachment 1 is in AUTOCAD Effect attachment 2 is the effect in QCAD. Is there any way to make the effect consistent?
Attachments
Drawing1 - 副本 (2).dxf
(452.53 KiB) Downloaded 553 times
VeryCapture_20231028132749.jpg
VeryCapture_20231028132749.jpg (301.41 KiB) Viewed 11294 times
VeryCapture_20231028132736.jpg
VeryCapture_20231028132736.jpg (262.8 KiB) Viewed 11294 times

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD3.28.2 explode function problem

Post by CVH » Sat Oct 28, 2023 7:32 am

WildWolfCJ wrote:
Sat Oct 28, 2023 6:30 am
Is there any way to make the effect consistent?
Probably when having the font files but I also stated that:
CVH wrote:
Fri Oct 27, 2023 8:30 am
Even then it may that QCAD ... Qt renders it a bit different than in the source application.
In the drawing provided on Sat Oct 28, 2023 7:30 am (Not trying to cite the dxf filename :wink:)
All 3 text entities are in the YouYuan font.
With that difference that the lower one is still formatted as Rich Text in SimSum.
Meaning that YouYuan is the main font but both lines of text are Rich Text formatted.
Double click on the lower text and see Source ... (Important: Cancel to close)

Without having both font files on my system these look like:

WildWolfCJ-YouYuan-SimSum.png
WildWolfCJ-YouYuan-SimSum.png (31.63 KiB) Viewed 11283 times

One can see very distinct differences with the provided image VeryCapture_20231028132736.jpg (Probably ACAD)
The two upper text faces are not rounded and have a different size with the boundary box.

When I merge VeryCapture_20231028132736.jpg with the dxf and scale the image for matching bounding boxes ...
The lower one is a fairly good match when setting X-Scale to about 0.97 and Line Spacing to 1.18

It is what it is.
Please include font files.

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”