trnsystor.anchorpoint.AnchorPoint

class trnsystor.anchorpoint.AnchorPoint(model, offset=20, height=40, width=40)[source]

Handles the anchor point. There are 6 anchor points around a component.

Initialize object.

Parameters
  • model (Component) – The Component.

  • offset (float) – The offset to give the anchor points from the center of the model position.

  • height (float) – The height of the component in points.

  • width (float) – The width of the component in points.

studio_anchor(other, loc)[source]

Return the studio anchor based on a location.

Parameters
  • other (TrnsysModel) – The other TrnsysModel used to find the anchor of self.

  • loc (2-tuple) – A 2-tuple of location, eg.: (“best”, “best”) or of anchor_ids.

find_best_anchors(other)[source]

Find best anchor points to connect self and other.

property anchor_points

Return dict of anchor points str->tuple.

property reverse_anchor_points

Return dict of anchor points tuple->str.

property studio_anchor_mapping

Return dict of anchor mapping str->tuple.

property studio_anchor_reverse_mapping

Return dict of anchor mapping tuple->str.

get_octo_pts_dict(offset=10)[source]

Define 8-anchor Point around the TrnsysModel.

In cartesian space and returns a named-dict with human readable meaning. These points are equally dispersed at the four corners and 4 edges of the center, at distance = offset.

Parameters

offset (float) – The offset around the center point of self.

Note

In the Studio, a component has 8 anchor points at the four corners and four edges. units.Links can be created on these connections.

../_images/anchor-pts.png
property centroid

Return centroid of self.