Offsetsrf command


#1

I want write a c++ function just like
offsetsrf command can do.
the function like that
on_Brep*(on_Brep* in_brep,double dis,bool flag SolideFlag);


(Dale Fugier) #2

Have you seen RhinoShellBrep()? See rhinoSdkUtilities.h for details.


#3

dale:
rhinoSdkUtilities.h can’t see rhinoshellbrep function


#4

help me to see my problem please


(Dale Fugier) #5

What version of the Rhino C++ SDK do you have? It sounds like you need a newer one.

from rhinoSdkUtilities.h in the latest Rhino C++ SDK:

/*
Description: 
  Creates a hollowed out shell from a solid Brep.
  Function only operates on simple, solid, manifold Breps.
Parameters:
  brep            [in] - The solid Brep to shell.
  faces_to_remove [in] - The indices of the Brep faces to remove. These surfaces
                         are removed and the remainder is offset inward, using
                         the outer parts of the removed surfaces to join the inner
                         and outer parts.
  distance        [in] - The distance, or thickness, for the shell.
                         This is a signed distance value with respect to face normals
                         and flipped faces.
  tolerance       [in] - The offset tolerane. When in doubt, use the document's
                         absolute tolerance.
  shells          [out] - The results of the shell calculation.
Return: 
  The number of breps added to the output array.
*/
RHINO_SDK_FUNCTION
int RhinoShellBrep(
  const ON_Brep& brep, 
  const ON_SimpleArray<int>& faces_to_remove,
  double distance,
  double tolerance, 
  ON_SimpleArray<ON_Brep*>& shells
  );

#6

dale:
this function only operates on simple, solid, manifold Breps.
but my brep may be not a solid brep.


(Dale Fugier) #7

The Rhino SDK does not have a function that will offset a non-solid, non-manifold Brep - sorry. But it might be possible to add something for a future service release. Would this help?


#8

[quote=“dale, post:7, topic:2186, full:true”]
The Rhino SDK does not have a function that will offset a non-solid, non-manifold Brep - sorry. But it might be possible to add something for a future service release. Would this help?
[/quote
thanks very much,but I need this function now ,can you give me some ideas how to write it myself


(Dale Fugier) #9

Sorry, no, but I cannot tell you how to write your own. I will add your request to the wish list. As we are about to start testing SR6, this wish will have to wait until SR7.


#10

thanks very much,dale


(Dale Fugier) #11

I’ve added a new RhinoOffsetBrep() function for SR7. When it is available, please try.


#12

Thanks very much,how long I can get SR7 version?


(Dale Fugier) #13

Its going to be a while - we are currently testing SR6.