algorithmic modeling for Rhino
if (S == null)
return;
Vector3d vec01 = new Vector3d();
Vector3d vec02 = new Vector3d();
if(G == null)
{
A = S.Transpose();
B = true;
}
else
{
//Reparameterize
Interval I = new Interval(0, 1);
S.SetDomain(0, I);
S.SetDomain(1, I);
G.SetDomain(0, I);
G.SetDomain(1, I);
int num1 = 0;
vec01.Set((S.PointAt(0.5, 0.5).X - S.PointAt(0.0, 0.5).X), (S.PointAt(0.5, 0.5).Y - S.PointAt(0.0, 0.5).Y), (S.PointAt(0.5, 0.5).Z - S.PointAt(0.0, 0.5).Z));
vec02.Set((G.PointAt(0.5, 0.5).X - G.PointAt(0.0, 0.5).X), (G.PointAt(0.5, 0.5).Y - G.PointAt(0.0, 0.5).Y), (G.PointAt(0.5, 0.5).Z - G.PointAt(0.0, 0.5).Z));
num1 = vec01.IsParallelTo(vec02, (1.5707963267948966 / 2));
if (num1 == 0)
{
A = S.Transpose();
B = true;
}
else
{
A = S;
B = false;
}
}
Hi Guys
Has this code ever been updated for the GH8.xxx Series and if not could someone post a working component containing the code please as can't get the code to work in any C# Components , both the old legacy version or new one.
All i get is Null outputs.
Thanks
Matt
Hi Matt
just change this two lines and it will work fine
Vector3d vec01 = new Vector3d((S.PointAt(0.5, 0.5).X - S.PointAt(0.0, 0.5).X), (S.PointAt(0.5, 0.5).Y - S.PointAt(0.0, 0.5).Y), (S.PointAt(0.5, 0.5).Z - S.PointAt(0.0, 0.5).Z));
Vector3d vec02 = new Vector3d((G.PointAt(0.5, 0.5).X - G.PointAt(0.0, 0.5).X), (G.PointAt(0.5, 0.5).Y - G.PointAt(0.0, 0.5).Y), (G.PointAt(0.5, 0.5).Z - G.PointAt(0.0, 0.5).Z));
and delete
Vector3d vec01 = new Vector3d();
Vector3d vec02 = new Vector3d();
on top
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by