Grasshopper

algorithmic modeling for Rhino

Hi All,

I am attempting to preform a uniform offset on joined surfaces within grasshopper.

I have a python script which preforms the correct surface offsets inside the python editor.  

def Offset(Block,Distance):
"""
Creates in interior offset of a joined polysurface
Input Parameters:
Block - (Surface) to be offset.

Distance - (Real Number) distance to offset surfaces

Returns:
Join - (Suface) offset surface.
"""
rs.Command("_SelNone")
rs.SelectObject(Block)
cmd="-_OffsetSrf "
cmd+=str(Distance)
cmd+=" .125 "
cmd+="Corner=Sharp "
cmd+="FlipAll "
cmd+="Enter "
rs.Command(cmd)
Offset=rs.LastCreatedObjects()
rs.Command("_SelNone")
Exp=rs.ExplodePolysurfaces(Offset,True)
Join=rs.JoinSurfaces(Exp,True)
return Join

However, I have not been able to duplicate these results through any means within grasshopper or grasshopper python.

What is the proper means which will allow this to function within a grasshopper python component or just standard grasshopper?  I was thinking maybe this this could be implemented somehow through rhino common?

Attached are is the surface I have been testing with and the results I have generated thus far.

Thanks in advance,

5chmidt

Views: 2204

Attachments:

Replies to This Discussion

Hi Peter,

As far as I can tell the Rhino _OffsetSrf command is not yet implemented in RhinoCommon for breps (see this). The only method I could find was Brep.CreateFromOffsetFace (see attached file for example) which offsets the individual brep faces. That will probably not really help you though..

Best,

Anders

Attachments:

Hi Peter,

I am trying to do something similar (I have posted a discussion), on my discussion you can see that I have successfully managed to offset 3 surfaces at once.

The method has essentially been to offset the faces, extend theses faces till they overlap, calculate the intersection points and reconstruct the geometry. It only works in my definition because I scale the offset surfaces in a single direction, I cannot figure out how to extend the surface...

I'm saying this as it may be another option to what you are trying to achieve that you may not have considered (not sure). My goal is to create a way to 'thicken' multiple surfaces at once as a surface/brep.

I found this also (link), it's a VB script that extends surfaces although because I have no knowledge in VB scripting I cannot get it to extend about its North and South at the same time.

Hope this helps in some way :)

Matthew

Hi Peter, if the surface is merely a planar curve extruded like your TestSrf, why not use the Offset (Curve) component, and extrude that output?

Thanks for the reply,

Unfortunately, many of the extruded polycurves I need to offset are not planar.  Sorry for the unclear example.

5chmidt

But they are straight extrusions?

Yes, they are all straight extrusions.  I did some experimentation with rs.OffsetCurveOnSurface() then doing the extrusion but I have found that has issues with how the curves are offset, often the offset curves start as joined poly curves and the result is multiple disconnected curves. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service