I have four planar circles not all the same diameters and I need to create a polyline through the quad points of each circle at 0 degrees or top dead centre, 90 degrees, 180 degrees and 270 degrees.
What is the best approach as I cannot find anything in Rhinoscriptsyntax that might help but I could have missed it.
I can do it by co ordinates but it is not a neat solution, all help appreciated.
Two small circles and two large circles and i am wanting to add the 4 polylines at each quadrant so I can use AddNetworkSrf along with the circles to get the following
the orientation is not set and can vary so it will have to be related to the direction of the circle centres big to small or plane of the large circles not sure.
Hi @RogerD, wouldn’t Brep.CreateFromLoft work better (using straight sections) ?
alternatively you might try below, first circle defines where the quads are:
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def DoSomething():
message = "Select 4 cirles in order"
crv_ids = rs.GetObjects(message, 4, True, False, False, None, 4, 4)
if not crv_ids: return
curves = [rs.coercecurve(c, -1, True).ToNurbsCurve() for c in crv_ids]
params = curves[0].DivideByCount(4, True)
points = [curves[0].PointAt(t) for t in params]
plists = []
plists.append(points)
for crv in curves[1:]:
pts = [crv.PointAt(crv.ClosestPoint(pt)[1]) for pt in points]
plists.append(pts)
for pts in zip(*plists):
polyline = Rhino.Geometry.Polyline(pts)
scriptcontext.doc.Objects.AddPolyline(polyline)
DoSomething()
Thank you for your reply I am just going through it now. I have also just discovered that the following
import rhinoscriptsyntax as rs
obj = rs.GetObject(“Select ellipse”)
if rs.IsEllipse(obj):
rs.AddPoints( rs.EllipseQuadPoints(obj) )
works on circles as well as ellipse, who would have thought that from the description.
Regarding the use of loft I found the straight edge / top was sometimes losing it correct line but will re check with all the options again.
Will let you know how I get on, its great to have an independent point of view and perspective on a problem, so thank you very much for your time and experience.
Thought I would update you with how I got on as you were kind enough to help me. The screenshots below show the selection of the pipework entity along with any size, poundage etc criteria. Then I select the line on which they are to be inserted along with the IP of the open end and the direction of the entity the item is then modelled from an ini file containing all the relevant dimensions.
I originally wrote these routines in RVB many years ago but as Rhino has moved on so must I.