Opened 5 years ago

Closed 4 years ago

#5840 closed defect (invalid)

Don't return origin if not defined

Reported by: adeas31 Owned by: adrpo
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 adeas31 5 years ago.
X.mos (80 bytes) - added by adeas31 5 years ago.

Download all attachments as: .zip

Change History (13)

Changed 5 years ago by adeas31

Changed 5 years ago by adeas31

comment:1 Changed 5 years ago by adeas31

  • Owner changed from somebody to adrpo
  • Status changed from new to assigned

comment:2 Changed 5 years ago by casella

@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 Changed 5 years ago by adrpo

Dymola again does the the non standard: let's rotate with origin as center of extent, not {0, 0} .

comment:4 Changed 5 years ago by adeas31

@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 Changed 5 years ago by casella

@#%&@@!!!

comment:6 Changed 5 years ago by casella

Seriously, we should check with DS first. There are other tools than Dymola, which are probably following the standard as well.

comment:7 Changed 5 years ago by casella

@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 casella (previous) (diff)

comment:8 follow-up: Changed 5 years ago by adeas31

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 in reply to: ↑ 8 Changed 5 years ago by casella

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 Changed 4 years ago by adeas31

  • Resolution set to invalid
  • Status changed from assigned to closed

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.