function(... , startRef="bottom", ...) let( startAngel = (startRef == "left") ? 0 : (startRef == "bottom") ? 90 : (startRef == "right") ? 180 : (startRef == "top") ? 270 : undef, r = radius,
===========Now if the variable is not "left", "bottom" etc.the startAngle value is "undef"
it works, but it happens that I would like to be able to enter degrees as a reference value.
something like
========== startAngel = (startRef == "left") ? 0 : (startRef == "bottom") ? 90 : (startRef == "right") ? 180 : (startRef == "top") ? 270 : startRef == startRef==========
Is it possible? (the last example doesn't work)
---================//====== circleSect
---=============================// Create rounded corners 2D// https://openhome.cc/eGossip/OpenSCAD/SectorArc.html// ange .: x, y, radien,// [från, till] vinkel,// var vinkeln startar, (left, bottom, right, top)// vilken rotation (-1=medsol, 1=motsols)function circSect(x=0, y=0, radius=10, angles=[0,270], startRef="bottom", rotate=1, fn=24) = let( startAngel = (startRef == "left") ? 0 : (startRef == "bottom") ? 90 : (startRef == "right") ? 180 : (startRef == "top") ? 270 : undef, r = radius, //r = radius / cos(180 / fn), step = 360 / fn, // points = [[x, y], points = [ for(a = [angles[0]-startAngel : step : angles[1]-startAngel]) [-rotate * r * cos(a)+x, r * sin(a)+y]] ) points;//======== Slut circleSect
---======================