algorithmic modeling for Rhino
Hi,
I had regionSlit component error: "regions must be planar".
Usual one, and I did not know how to solve, all my regions were planar because in gh was able to create planar surfaces. I was also working just in polylines.
I tried simplifying curves, project to plane, that was created by points, still result in some failed regions , but for majority it worked. Then instead of this I tried this :
I tested not nice approach of de-compiling the component and changing this code -projecting the curve inside component that solved this issue. I only changed slab function in the class slab this function. I do not know if it helps for other as maybe other errors may occur, but in my case it worked well for all the elements.
public Slab(int index, Curve shape)
{
//Here curve is projected by division points
Point3d[] divisionPoints;
shape.DivideByCount(10, false, out divisionPoints);
Plane planeTemp;
Plane.FitPlaneToPoints(divisionPoints.ToList(), out planeTemp);
shape = Curve.ProjectToPlane(shape, planeTemp);
this.Cutters = new List<Line>();
this.Index = index;
this.Region = shape;
this.Bounds = shape.GetBoundingBox(true);
this.Plane = planeTemp;
//Exception that was causing error
//if (!shape.TryGetPlane(ref this.Plane))
//throw new ArgumentException("shape must be a planar region");
if (!this.Plane.IsValid)
throw new ArgumentException("shape must be a planar region");
}
Tags:
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