discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

endPointInView function

Vector2? endPointInView(
  1. ParametricView view,
  2. Handle self,
  3. DimEnd end
)

The world point of end of dimension self in view (spec 11 D6), or null when the end is broken (D7): an attached end whose wall is not a live wall or whose k is outside {0, 1}, or a fixed end with a non-finite coordinate.

Implementation

Vector2? endPointInView(ParametricView view, Handle self, DimEnd end) {
  switch (end) {
    case FixedEnd(:final x, :final y):
      if (!x.isFinite || !y.isFinite) return null;
      return view.toWorld(self).transformPoint(end.point);
    case AttachedEnd(:final wall, :final k, :final side):
      if (k != 0 && k != 1) return null;
      final w = wallsInView(view, wall);
      if (w == null) return null;
      return wallEndPoint(w.host, w.walls, k, side);
  }
}