"beam" - mkraska/meclib GitHub Wiki

[ "beam", "", [x1, y1], [x2,y2], r, state ]

[ "beam", "<color1>","<color2>", [x1, y1], [x2,y2], r , state ]

Rectangle with black border and light gray filling. The rectangle essentially is a thick line connecting two points. r is the radius (half width). More than two points (must be an even number of points) can be handled, in this case multiple rectangles are generated and merged into a single contour if they overlap. For non-merged overlapping beams use separate beam objects.

  • "" or "<color1>","<color2>" colors for the gradient filling. If empty, the default light gray filling is used. The gradient is tried to be in lateral direction if possible (only horizontal or vertical gradients are possible)
  • [x1, y1], [x2, y2] start and end point. Multiple pairs of start and end points can be specified.
  • r radius (half width) of the beam
  • state (default: "locked") "hide" or "show". If missing, object can't be switched interactively.

Examples

Beam with gradient fill

image

[
  [ "grid", "","", -1,6,-2,2, 50 ],
  [ "beam", "white", "gray", [0,0], [0.5, 0], 0.2 ],
  [ "beam", "white", "gray", [0.5,0], [1.5, 0], 0.4 ],
  [ "beam", "white", "gray", [1.5,0], [2, 0], 1 ],
  [ "beam", "white", "gray", [2,0], [4.5, 0], 0.4 ],
  [ "beam", "white", "gray", [4.5,0], [5, 0], 0.2]
]

Compound beam, overlapping beam, hidden beam

image

[
   [ "grid", "","", -5,5,-4,5, 50, [10,10], [0,0] ],
   ["beam","",[0,3],[2,4],[0,4],[2,3], 0.15],
   ["beam","",[2,4],[3,4.5], 0.08],
   ["beam","",[1,4],[1,2], 0.1, "hide"]
]
⚠️ **GitHub.com Fallback** ⚠️