algorithmic modeling for Rhino
Hi! I am trying to do a Loft between a set of curves and the curves resulting from an offset of that same set. The Loft component gives me the next error message: "Data conversion failed from Curve to Loft Options". Also, I couldn't really do the offset with the Offset component, I had to use a Scale component as the Offset component gave me the following error message: "Curve offset failed". I am attaching the *.gh file so anyone can take a look at it and advise me on what's going on. I have circled the two error components with blue and purple sketch lines.
Cheers!
Fernando Maytorena
Tags:
Hi fernando,
I have not got access to grasshopper today but from the error message above i guess you are trying to place curves into both inputs of [loft]. Only the upper input should take all of the curves you want to loft. The lower input is reserved for [loft options] a component dedicated to allowing you to change the types of lofts and how they are built.
Sorry i cannot help further with the offset failure.
When you see an error that looks like:
Data conversion failed from X to Y
it means that you are providing data of type X to an input parameter of type Y and there is no automatic conversion defined between the two. A simple example would be if you plug Integer data into a Text parameter. It's perfectly possible to create a piece of text which represents the integer. I.e. the value 18 becomes the text "18".
It's also possible to convert a floating point number to text, although in that case the conversion is not lossless, as the text only shows a limited number of decimals, thus rounding the actual numeric value.
In your specific case here, you have connected a Curve parameter output with the Loft Options input. Loft options are about the type of loft, whether or not to rebuild/refit the resulting loft surface and -if so- what sort of tolerance to use.
If you look at the tooltips of the input parameter for the Loft component, you'll see that the first one takes all the section curves and the second one takes the options to be used to make the loft. You'll have to put all your curves into the first input:
This can be accomplished by holding SHIFT while making the second connection.
However this will generate a new problem. Loft operates on a list of curves, and for each list of curves you provide it will try to create a single loft. But if you merge the two curve streams, you'll sometimes get lists of 4 curves, this is probably not what you want.
At any rate, Loft is probably not what you want in the first place as an offsetted curve (especially curves with kinks) will result in incredibly messy lofts. I'd recommend Boundary Surface as an alternative, but that will generate trimmed surfaces, which may not be acceptable for you.
Now then, on to the Offset failure. Curve offsetting is a planar operation. By default, the plane in which Offset works is the world XY plane. Your curves are all perpendicular to the world XY plane, so that is already problematic. The fix would be easy (plug the curves also into the Offset P input), were it not that one of your section curves is wonky. This is probably either due to a bug in the Rhino Brep|Plane intersector or it's a problem with the input Brep. Either way, I could not get one of the curves to offset correctly, no matter what I tried.
In the end I solved it by using Loose Offset, which also means that the loft works much better because both the interior and the exterior curve have identical topology (see attached). Do note that Loose Offset does not guarantee an offset accurate to within document tolerance, it only moves the control-points.
--
David Rutten
david@mcneel.com
Hi David
I'm trying to script loft in python but I get type conversion error from text to loft options... My question is what type of data Loft Options is?
list_crv=[m6,m5,m4,m2,m3,m1,m7]
list_crv=ghcomp.trees.FlattenTree(list_crv,{0})
l_o=ghcomp.trees.FlattenTree(ghcomp.LoftOptions(True,True,0,0,4),{0})
head_geo=ghcomp.Loft(list_crv,l_o)
Loft: input 2 Options. error: Data conversion failed from Text to Loft Options
Hi
I don't get this error. It also seems that the dictionary of the loft options described by the string is not deserialised properly to the correct options.
The default options seem to work as expected. Anything else doesn't.
Why aren't you using the rhinocommon method.?
kind regards,
M
If I use
head_geo=rg.Brep.CreateFromLoftRefit(list_crv,0,0,rg.LoftType.Developable,True,0.001)
I get
1. Solution exception:expected IEnumerable[Curve], got list
For now I've used
head_geo=rs.AddLoftSrf(list_crv,None,None,4,0,0,True)
and it works
Any idea how to get rhinocommon method working?
You will have to import a .net List by importing System.Collections.Generic.
from System.Collections.Generic import List
ieList = List[rc.Geometry.Curve]()
for crv in list_crv:
ieList.Add(crv)
This should be working.
Best,
M
Oh that's great, makes a lot of sense thank you. I'll try it on Monday
That worked!
Thank you Marios
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by