algorithmic modeling for Rhino
So simply,i want to know how it's possible to get a new NurbSurface by the method SetControlPoint() in the NurbSurface sub, if i understand well 3 inputs are required 2 integers and 1 ControlPoint, but like it's expected by IntelliSense i got a boolean :( with no error ... but i just need a new nurbs srf any sugestion ?
below Srf as Surface, U and V as int et Pt1 as ControlPoint
<code>
Srf.ToNurbsSurface().Points.SetControlPoint(U, V, Pt1);
</code>
Tags:
Hi Julz,
because ToNurbsSurface() returns a new surface, you should store that in a new variable and work from there. With this single statement, the new surface that you might achieve to modify is anyways lost.
Cheers,
- Giulio
________________
giulio@mcneel.com
How about this:
NurbsSurface ns = input_srf.ToNurbsSurface(); //stores new surface
ns.Points.SetControlPoint(a, b, c);
//...
A = ns; //do not return input_srf
Cheers,
- Giulio
________________
giulio@mcneel.com
Is this a question? Can you upload a sample please?
Thanks,
- Giulio
________________
giulio@mcneel.com
Here the "bug" isolation, hop that can help... Thanks again Giulio.
This is very tricky, but there is no bug here at first sight. The tricky part is that Point3d is a value type.
See Value Types and Reference Types on Msdn for more information.
On line 116 you are modifying (with the Transform method) a copy of the Location of Pt1, and not the Location of Pt1 itself. Location can only be modified by assigning a new value to it, like this:
Pt1.Location = somePoint;
This is a rule in C# (and Vb.Net), and is somehow similar to the problem in the first post, where a copy was modified. To avoid this, I have a small suggestion: it often helps to write only one expression part per line, and use well named variables to store their results.
- Giulio
________________
giulio@mcneel.com
Hi Julz,
I cannot answer the question above directely because it is nested too deeply. Also, I am not so sure what the v normal of the ControlPoint is.
Can you start a new thread with that question? Maybe with a small diagram: that would really help.
Thanks,
- Giulio
_______________
giulio@mcneel.com
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