Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview for trimmed surfaces #431

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}