Skip to content

Commit

Permalink
Redoing #431
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelbaran committed Nov 12, 2019
1 parent 9b4a48b commit 8400315
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Grasshopper_Engine/Compute/RenderMeshes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ public static void RenderMeshes(BHG.Loft surface, Rhino.Display.DisplayPipeline

public static void RenderMeshes(BHG.NurbsSurface surface, Rhino.Display.DisplayPipeline pipeline, DisplayMaterial material)
{
pipeline.DrawBrepShaded(RHG.Brep.CreateFromSurface(surface.ToRhino()), material);
RHG.GeometryBase geometry = surface.ToRhino();
if (geometry is RHG.Surface)
geometry = RHG.Brep.CreateFromSurface((RHG.Surface)geometry);

pipeline.DrawBrepShaded((RHG.Brep)geometry, material);
}

/***************************************************/
Expand Down
7 changes: 5 additions & 2 deletions Grasshopper_Engine/Compute/RenderWires.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ public static void RenderWires(BHG.Loft surface, Rhino.Display.DisplayPipeline p

public static void RenderWires(BHG.NurbsSurface surface, Rhino.Display.DisplayPipeline pipeline, Color bhColour)
{
RHG.Surface rSurface = surface.ToRhino();
pipeline.DrawSurface(rSurface, bhColour, 2);
RHG.GeometryBase geometry = surface.ToRhino();
if (geometry is RHG.Surface)
geometry = RHG.Brep.CreateFromSurface((RHG.Surface)geometry);

pipeline.DrawBrepWires((RHG.Brep)geometry, bhColour, 2);
}

/***************************************************/
Expand Down
3 changes: 2 additions & 1 deletion Grasshopper_Engine/Convert/FromGoo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public static T FromGoo<T>(this GH_Surface goo, IGH_TypeHint hint = null)
Brep brep = goo.ScriptVariable() as Brep;
if (brep.IsSurface)
return (T)(brep.Faces[0].UnderlyingSurface() as dynamic);
return default(T);
else
return (T)(brep as dynamic);
}
}
}

0 comments on commit 8400315

Please sign in to comment.