Opened 5 years ago
Closed 5 years ago
#5840 closed defect (invalid)
Don't return origin if not defined
Reported by: | Adeel Asghar | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | Interactive Environment | Version: | |
Keywords: | Cc: |
Description
Right now we return {0, 0}
when fetching icon or diagram annotation even if the graphic shape doesn't have an origin. This causes problems since then the rotation and other transformations are done based on the origin which is wrong.
Attachments (2)
Change History (13)
by , 5 years ago
by , 5 years ago
comment:1 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 5 years ago
comment:3 by , 5 years ago
Dymola again does the the non standard: let's rotate with origin as center of extent, not {0, 0}
.
comment:4 by , 5 years ago
@casella open the attached model in Dymola and OM. The diagram looks the same i.e., one rectangle. Now rotate the rectangle. Dymola creates a new origin that is the center of the rectangle and rotates around it. OM uses {0, 0}
as origin and rotates around it.
comment:6 by , 5 years ago
Seriously, we should check with DS first. There are other tools than Dymola, which are probably following the standard as well.
comment:7 by , 5 years ago
@adeas31, I guess this is related to #5816, right?
Is it possible that we get the right result by adding the appropriate origin to the extent (which corresponds to the center of the extent itself)?
What I mean is, I prefer to add the origin annotation manually to my few existing Dymola-made models (which shouldn't affect how they behave in Dymola) until the next version of Dymola does it automatically, rather than having OMC not following the standard.
follow-up: 9 comment:8 by , 5 years ago
It is not related to #5816 but I figured it out while working on the fix for it.
@casella I will open an issue on Modelica specification github tomorrow to discuss this.
comment:9 by , 5 years ago
comment:11 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
The default value of origin is always {0, 0}
. See the discussion on the ModelicaSpecification issue 2495.
@adeas31, the Modelica Specification Section 18.6.1 defines a default
origin = {0, 0}
for all graphical entities. Why shouldn't this be returned, and what would be the location of the center of rotation in case an origin is undefined?