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)

X.mo (212 bytes ) - added by Adeel Asghar 5 years ago.
X.mos (80 bytes ) - added by Adeel Asghar 5 years ago.

Download all attachments as: .zip

Change History (13)

by Adeel Asghar, 5 years ago

Attachment: X.mo added

by Adeel Asghar, 5 years ago

Attachment: X.mos added

comment:1 by Adeel Asghar, 5 years ago

Owner: changed from somebody to Adrian Pop
Status: newassigned

comment:2 by Francesco Casella, 5 years ago

@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?

comment:3 by Adrian Pop, 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 Adeel Asghar, 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:5 by Francesco Casella, 5 years ago

@#%&@@!!!

comment:6 by Francesco Casella, 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 Francesco Casella, 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.

Last edited 5 years ago by Francesco Casella (previous) (diff)

comment:8 by Adeel Asghar, 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.

in reply to:  8 comment:9 by Francesco Casella, 5 years ago

Replying to adeas31:

It is not related to #5816 but I figured it out while working on the fix for it.

Good.

@casella I will open an issue on Modelica specification github tomorrow to discuss this.

Excellent, thanks!

comment:11 by Adeel Asghar, 5 years ago

Resolution: invalid
Status: assignedclosed

The default value of origin is always {0, 0}. See the discussion on the ModelicaSpecification issue 2495.

Note: See TracTickets for help on using tickets.