-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version V1.7.1.1.a: The plotter software encountered an error while reading entities stored in blocks with inconsistent scaling ratios in the X and Y directions #375
Comments
Thanks again for finding a bug 😉 |
Check latest release: https://github.com/svenhb/GRBL-Plotter/releases |
Thank you very much for your hard work. There are still some issues with version v1.7.1.2, and the areas indicated by A, B, and C circled in the screenshot still have issues. The polyline and point at point A are saved in the same block. I guess the problem at point A is related to rotation The arc and line at point B are saved in the same block. The circle and line at point C are saved in the same block. There is still an issue with parsing circles, arcs, and polylines in the block. There is still a problem with the resolution of graphic colors. The colors displayed on the plotter are different from those in CAD. |
Can you save with an older DXF version? |
Latest dxf format reference document https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-A85E8E67-27CD-4C59-BE61-4DC9FADBE74A The screenshot below shows the use of a plotter software to read the 2007 version of dxf. The plotter software still has issues parsing the 2007 version of dxf files. 2007 version of dxf file The arcs and circles stored in the block look like ellipses when inserted into dxf if the ratio of the X and Y directions is different, because the arcs and circles are stretched in the X or Y direction When the scaling ratios of the arcs and circles stored in the block are not consistent in the X and Y directions when inserting the block, the circles and arcs should be converted into ellipses for processing and analysis. The ratio of the major and minor axes of the ellipse is the ratio between the scaling coefficients in the X and Y directions when inserting the block. A new algorithm should be added to handle this situation separately |
Try new release: https://github.com/svenhb/GRBL-Plotter/releases |
Thank you for updating the new version. When testing version 1.7.3.0 of the plotter software, I found some issues. In the dxf file, point 1 in the following image coincides with the endpoint 3 of the elliptical arc, while points 2 and 4 coincide; However, when using version 1.7.3.0 plotter to read dxf, point 1 does not coincide with endpoint 3 of the elliptical arc, and points 2 and 4 do not coincide When I draw the graph, the endpoints of the points and elliptical arcs coincide. The resolution of coordinate values for the starting and ending points of elliptical arcs is incorrect in the latest version of the plotter software The screenshot below shows the difference in the coordinates of the endpoint of the elliptical arc displayed in CAD and plotter. A is the coordinate value of the endpoint of the elliptical arc displayed in CAD, and point B is the coordinate value of the endpoint of the elliptical arc displayed in plotter |
Will change the code: |
Check latest release: https://github.com/svenhb/GRBL-Plotter/releases |
Thank you for releasing the new version. I will conduct some testing |
Version V1.7.3.1 still does not solve the problem of parsing the coordinate points stored in the block after the elliptical arc is rotated and scaled in the X and Y directions. I drew two points at the starting and ending points of the elliptical arc. If I observe that the starting and ending points of the elliptical arc do not coincide with the point in the plotter, it indicates that the coordinate values of the starting and ending points of the elliptical arc are parsed incorrectly. I did this to facilitate the observation of whether the calculated coordinate values are incorrect in the plotter after parsing. At the same time, I will take screenshots of the coordinate values displayed in CAD and plotter for comparison of this dxf file test dxf file |
Version 1.7.3.1 of the software does not have settings that allow users to decide whether circles and arcs should generate g02/g03 or g01. Currently, this version can only generate g02/g03 for circles. |
No need for an extra setting: if (scaling.X == scaling.Y) G02/G03 will be used (if enabled). |
Where is (if enabled) enabled? If scaling X=scaling Y, what should I do to make the circle generate G01? |
Thank you |
Check “Process dashed line patte”and uncheck“Avoid G2/3 (Arc Move) commands, draw arcs/circles with line s Ad”,So, the dotted circle generates G01, and the solid circle generates G02. Is that correct? |
Yes |
I haven't changed any other options. I'll upload the file I used for testing and give it a try |
Ok, there's a bug with DXF import: once the line pattern was set, it couldn't be reset. |
About dash pattern: Try test version https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731a.exe The other problem (start / end pos of ellipse) I can't fix for now. Must be a rounding error, when converting angles back an forth. |
Thank you for your hard work. I will conduct some tests. After my testing, if the elliptical arc does not exist in the block, the starting and ending coordinates parsed by the plotter software are correct. However, if the elliptical arc exists in the block, and the block is rotated and scaled, the plotter software will read the starting and ending coordinates parsed by the block again, which will be incorrect. |
Elliptical arcs stored in blocks, incorrect resolution of starting and ending coordinates It is not an elliptical arc stored in a block, and the resolution of the starting and ending coordinates is correct test file |
The starting angle of an elliptical arc Termination angle of elliptical arc Perhaps the insufficient accuracy of the numerical values read in dxflib resulted in inaccurate angle values for the starting and ending points of the elliptical arc test dxf |
Yes, as soon as there are different scalings for X and Y inside the block, the angles a1, a2 are no longer correct. |
I clicked on the part you selected in the red box, do I need to set any other options? |
the "large" variable is needed to determine the arc behavior: |
I finally found the reason, not because the scaling ratio of x direction and Y direction was inconsistent, but because the elliptic arc was stored in the block with an Angle, which was 13.178191. The elliptic arc in plotter's parsing block did not take into account that the elliptic arc in the block also had an Angle. Now I have adjusted the Angle to 0, and plotter will The parsing is normal. So we should take this into account when analyzing the elliptic arc in the block The elliptic arc in the block has no Angle screenshot Angular screenshot of the elliptic arc in the block Open the Elliptic Arc Block editor to measure the Angle of the screenshot |
The x and y scales of the above two screenshot blocks are both 2:1 |
This angle is given by ellipse.MainAxis coordinates. (Endpoint of major axis, relative to the center) |
YES,Does the current code include 13.178191 when calculating coordinates? |
I know why the problem happened,(double w = ellipse.AxisRatio * (double)scaling.Y/(double)scaling.X;) By default, the major axis of the ellipse is parallel to the X-axis of the coordinate system, and the minor axis of the ellipse is parallel to the Y-axis of the coordinate system, but if the ellipse in the block has an Angle, the value of the variable w is not correct, and I think it should be calculated by affine transformation company. |
.NET open source library for matrix operations, which I thought I might use when parsing ellipses |
I have pinpointed the direction of the problem, or did I encounter a problem while parsing the scaling of the elliptical block? Period Sx: Scale in the x direction
|
I have identified the real reason for the incorrect parsing of ellipses and arcs within a block. The different scaling ratios in the X and Y directions are not the cause of this problem. The real reason is that if there are angles between the elliptical arcs and arcs within the block (the major axis of the ellipse is not parallel to the X direction of the coordinate system), this problem will occur The difference between Ellipse 1 and Ellipse 2 in the ArSeg diagram is that Ellipse 1 has an angle within the block, while Ellipse 2 has no angle within the block; When inserting ellipses 1 and 2, the scaling ratios in the X and Y directions are different, but ellipses 1 are parsed correctly and ellipses 2 are parsed incorrectly test dxf file |
I assume the current order is wrong: now 1st I apply xy scaling to the ellipse-properties, then I calculate the ellipse points. |
Firstly, obtain the coordinates before scaling, then use matrix operations to calculate the scaled coordinates, and then use the calculated coordinates to form a transformed ellipse. As I am not very familiar with programming, I can only provide you with the conclusion I have drawn after verification in CAD to provide you with an idea |
I hope now it is correct, check https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731g.exe |
There is still a bug for circle with blockScaling.X != blockScaling.Y. But the fundamental problem has been found... |
Thank you for updating the software. I will conduct some necessary tests. |
Should be fixed now: https://github.com/svenhb/GRBL-Plotter/releases |
Version V1.7.1.1.a: The plotter software encountered an error while reading entities stored in blocks with inconsistent scaling ratios in the X and Y directions.
The different scaling ratios in the X and Y directions of the entities in the block in the dfx file can cause errors in the plotter software's reading.
The software version of the plotter used for testing is v1.7.1.1.a, and I guess this issue should exist in all versions.
Screenshot of CAD software
Screenshot of the plotter software
The dxf file used for testing
1 - (2).zip
The color display of graphics in the drawing software when reading dxf is different from what is displayed in the CAD software
The display colors of the elements indicated by 1, 2, and 3 in the screenshot are different
The text was updated successfully, but these errors were encountered: