Skip to content

Commit

Permalink
Fix for Grasshopper to build.
Browse files Browse the repository at this point in the history
  • Loading branch information
alelom authored and al-fisher committed Mar 5, 2021
1 parent e89ea4b commit 7919866
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Rhinoceros_Engine/Convert/ToRhino.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public static RHG.Brep ToRhino(this List<BHG.ISurface> surfaces)

/***************************************************/

public static RHG.GeometryBase ToRhino(this BHG.Extrusion extrusion)
public static Rhino.Geometry.Surface ToRhino(this BHG.Extrusion extrusion)
{
if (!extrusion.Curve.IIsPlanar())
{
Expand Down Expand Up @@ -493,7 +493,13 @@ public static RHG.GeometryBase ToRhino(this BHG.Extrusion extrusion)
.PerformSweep(rail, planarCurve)
.Aggregate((b1, b2) => { b1.Join(b2, tolerance, true); return b1; });

return joinedSweep;
if (joinedSweep.IsSurface)
return joinedSweep.Surfaces[0];

BH.Engine.Reflection.Compute.RecordError("Could not convert this BHoM Extrusion to a Rhino Surface. The extrusion direction is not perpendicular to the base curve, and the base curve is too complex for a Sweep to return a valid Surface.");


return null;
}


Expand Down

0 comments on commit 7919866

Please sign in to comment.