I tried using ArcCurve and LineCurve but the joinCurve is still not working i also checked if they are touching.
The creation of curves is successful but when I use JoinCurves in the end it gives an input type error again
# Define width and height
width = 3
height = 3
# Define the line
z = -radius - height
start_point_line = Rhino.Geometry.Point3d(0, -width / 2, z)
end_point_line = Rhino.Geometry.Point3d(0, width / 2, z)
line = Rhino.Geometry.LineCurve(start_point_line, end_point_line)
# Add the line to the document
model.Objects.AddCurve(line)
# Define the arc
start_arc_point = Rhino.Geometry.Point3d(0, width / 2, -radius - width)
end_arc_point = Rhino.Geometry.Point3d(0, -width / 2, -radius - width)
arc_point = Rhino.Geometry.Point3d(0, 0, -radius)
arc = Rhino.Geometry.Arc(start_arc_point, arc_point, end_arc_point)
# Create an ArcCurve from the Arc
arc_curve = Rhino.Geometry.ArcCurve(arc)
# Add the arc curve to the document
model.Objects.AddCurve(arc_curve)
# Ensure the curves are in a list
curves = [line, arc_curve]
joined_curves = Rhino.Geometry.Curve.JoinCurves(curves)
I would presume you need to cast your objects to all be “Curve” objects, not more specific things like Arcs or Lines. It’s telling you the input is of the wrong type, that’s what it’s saying.
This is a core concept for making sense of Rhinocommon, how you can/have to look at the same geometry through different structures. I usually use Rhinoscript for it but I would guess it’s through the ToNurbsCurve. Of course you can just look up the source of the rs.CoerceCurve function.