Skip to content
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

Near-zero coordinates in graphical annotations #4072

Closed
DagBruck opened this issue Jan 18, 2023 · 4 comments · Fixed by #4107
Closed

Near-zero coordinates in graphical annotations #4072

DagBruck opened this issue Jan 18, 2023 · 4 comments · Fixed by #4107
Assignees
Labels
task General work that is not related to a bug or feature
Milestone

Comments

@DagBruck
Copy link
Contributor

Many models in MSL contain near-zero coordinates in graphical annotations, for example

annotation (Line(points={{5.55112e-16,-49},{0,-42}}, color={0,0,127}));

The most likely historical cause for these coordinates is a rounding-bug in Dymola. Anticipating the planned MSL-cleanup project, I have search for likely candidates that should be replaced by 0, see attached list: nearzero.txt

@DagBruck DagBruck added the bug Critical/severe issue label Jan 18, 2023
@DagBruck DagBruck changed the title Near-zero coordinates i graphical annotations Near-zero coordinates in graphical annotations Jan 18, 2023
@dietmarw
Copy link
Member

@DagBruck Does Dymola also have the ability to correct those near-zero coordinates? If yes then it would be an easy fix and you could provide a PR for this.

@dietmarw dietmarw added enhancement New feature or enhancement task General work that is not related to a bug or feature and removed bug Critical/severe issue labels Jan 23, 2023
@dietmarw dietmarw added this to the MSL4.1.0 milestone Jan 23, 2023
@beutlich
Copy link
Member

I previously cleaned them up manually, see for example 9b1f143, caeceed or even f7145a6.

I propose some CI check for it, otherwise it will just happen again.

@DagBruck
Copy link
Contributor Author

I propose some CI check for it, otherwise it will just happen again.

Probably a good idea, but note that "weird" numbers such as 1e-10 may occur naturally as parameters. At least the risk that Dymola adds the garbage has been reduced.

@TManikantan
Copy link
Contributor

Will close this issue, refer #4139 (used for missing commits) and #4107

TManikantan added a commit that referenced this issue Jun 1, 2023
* Resolved issue #4072 (for Modelica/Electrical)

* Resolved issue #4072 (for rest of Modelica)

* Squash doubled point {0,-50.5}

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Delete doubled connection's coordinate

* Fix near-zero coordinate in connection's annotation

* Merge branch 'DagBruck_01' of https://github.com/modelica/ModelicaStandardLibrary into DagBruck_01

---------

Co-authored-by: Dag Brück <dag.brueck@3ds.com>
Co-authored-by: tobolar <tobolar@users.noreply.github.com>
Co-authored-by: tobolar <jakub.tobolar@dlr.de>
beutlich pushed a commit to beutlich/ModelicaStandardLibrary that referenced this issue Jun 2, 2023
# Conflicts:
#	Modelica/Electrical/Machines/Examples/SynchronousMachines/SMPM_NoLoad.mo
beutlich pushed a commit to beutlich/ModelicaStandardLibrary that referenced this issue Jun 2, 2023
@beutlich beutlich removed the enhancement New feature or enhancement label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task General work that is not related to a bug or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants