Hi, Boyd:<br><br>Thank you for your codes. I believe that Cubit/geom now has these methods to call either ACIS or OCC engine to  directly create such surfaces. Our CGM based geom, which uses old cubit geom codes,  doesn&#39;t have these method in ACIS or OCC to directly create such surfaces. Users usually first create 3-D model and copy surfaces to create such surfaces, or it can also go with vertex to surface route.<br>
<br>Since CGM will be merged with Cubit, with user interface accessible to those method, these methods will make great ease to the users. I&#39;ll put these methods to our OCC base code then, and ready to be called through upper level geom codes.<br>
<br>Jane<br><br><br><br><div class="gmail_quote">On Mon, Dec 19, 2011 at 3:31 PM, Boyd Tidwell <span dir="ltr">&lt;<a href="mailto:bktidwell373@gmail.com">bktidwell373@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Tim and Jane,<br>
<br>
  In my testing I discovered a number of methods that hadn&#39;t been<br>
implemented and, because they didn&#39;t seem to difficult, I implemented<br>
them.<br>
<br>
I am told that it is OK to share them with cgma so here they are.  I<br>
can&#39;t claim they are perfect but they passed all the testing I threw<br>
at them.<br>
<br>
Enjoy!<br>
<br>
 - Boyd<br>
<br>
<br>
<br>
<br>
CubitStatus OCCModifyEngine::create_rectangle_surface( double width,<br>
<br>
             double height,<br>
<br>
             CubitVector plane,<br>
<br>
             BodySM *&amp;sheet_body) const<br>
{<br>
  //create points at the 4 corners<br>
  CubitVector pos1( width*0.5, height*0.5, 0 );<br>
  CubitVector pos2( -width*0.5, height*0.5, 0 );<br>
  CubitVector pos3( -width*0.5, -height*0.5, 0 );<br>
  CubitVector pos4( width*0.5, -height*0.5, 0 );<br>
<br>
  DLIList&lt;CubitVector*&gt; vec_list(4);<br>
  vec_list.append( &amp;pos1 );<br>
  vec_list.append( &amp;pos2 );<br>
  vec_list.append( &amp;pos3 );<br>
  vec_list.append( &amp;pos4 );<br>
<br>
  CubitStatus status = OCCModifyEngine::instance()-&gt;create_surface(<br>
vec_list, sheet_body, 0, CUBIT_FALSE );<br>
<br>
  //rotate it so that it is aligned with the plane defined by vector &#39;plane&#39;<br>
  CubitVector current_plane(0,0,1);<br>
  CubitVector axis_of_rotation = current_plane * plane;<br>
  double angle_of_rotation = axis_of_rotation.vector_angle(<br>
current_plane, plane );<br>
<br>
  OCCQueryEngine::instance()-&gt;rotate( sheet_body, axis_of_rotation,<br>
RADIANS_TO_DEGREES(angle_of_rotation) );<br>
<br>
  return status;<br>
}<br>
<br>
CubitStatus OCCModifyEngine::create_ellipse_surface( TBPoint *pt1,<br>
<br>
          TBPoint *pt3,<br>
<br>
          CubitVector center_point,<br>
<br>
          BodySM *&amp;sheet_body) const<br>
{<br>
  // make ellipse by creating two ellipse arcs in each sense direction<br>
  Curve *ellipse1 =<br>
OCCModifyEngine::instance()-&gt;make_elliptical_Curve( pt1, pt3,<br>
center_point, 0, 360, CUBIT_FORWARD );<br>
  if( NULL == ellipse1 )<br>
    return CUBIT_FAILURE;<br>
  DLIList&lt;Curve*&gt; curve_list(2);<br>
  curve_list.append( ellipse1 );<br>
<br>
  Curve *ellipse2 =<br>
OCCModifyEngine::instance()-&gt;make_elliptical_Curve( pt1, pt3,<br>
center_point, 0, 360, CUBIT_REVERSED );<br>
  if( NULL == ellipse2 )<br>
    return CUBIT_FAILURE;<br>
  curve_list.append( ellipse2 );<br>
<br>
  Surface *tmp_surface = OCCModifyEngine::instance()-&gt;make_Surface(<br>
PLANE_SURFACE_TYPE, curve_list, NULL, false );<br>
  if( NULL == tmp_surface )<br>
    return CUBIT_FAILURE;<br>
<br>
  sheet_body = OCCModifyEngine::instance()-&gt;make_BodySM( tmp_surface );<br>
  if( NULL == sheet_body)<br>
    return CUBIT_FAILURE;<br>
<br>
  return CUBIT_SUCCESS;<br>
}<br>
<br>
CubitStatus OCCModifyEngine::create_ellipse_surface( double major_radius,<br>
<br>
          double minor_radius,<br>
<br>
          CubitVector plane,<br>
<br>
          BodySM *&amp;sheet_body) const<br>
{<br>
  //create the points<br>
  CubitVector tmp_pt( major_radius, 0, 0 );<br>
  TBPoint *pt1 = OCCModifyEngine::instance()-&gt;make_Point( tmp_pt );<br>
<br>
  tmp_pt.set( 0, minor_radius, 0 );<br>
  TBPoint *pt2 = OCCModifyEngine::instance()-&gt;make_Point( tmp_pt );<br>
<br>
  CubitVector center_point(0,0,0);<br>
<br>
  // make ellipse by creating two ellipse arcs in each sense direction<br>
  Curve *ellipse1 =<br>
OCCModifyEngine::instance()-&gt;make_elliptical_Curve( pt1, pt2,<br>
center_point, 0, 360, CUBIT_FORWARD );<br>
  if( NULL == ellipse1 )<br>
    return CUBIT_FAILURE;<br>
  DLIList&lt;Curve*&gt; curve_list(2);<br>
  curve_list.append( ellipse1 );<br>
<br>
  Curve *ellipse2 =<br>
OCCModifyEngine::instance()-&gt;make_elliptical_Curve( pt1, pt2,<br>
center_point, 0, 360, CUBIT_REVERSED );<br>
  if( NULL == ellipse2 )<br>
    return CUBIT_FAILURE;<br>
  curve_list.append( ellipse2 );<br>
<br>
  Surface *tmp_surface = OCCModifyEngine::instance()-&gt;make_Surface(<br>
PLANE_SURFACE_TYPE, curve_list, NULL, false );<br>
  if( NULL == tmp_surface )<br>
    return CUBIT_FAILURE;<br>
<br>
  sheet_body = OCCModifyEngine::instance()-&gt;make_BodySM( tmp_surface );<br>
  if( NULL == sheet_body)<br>
    return CUBIT_FAILURE;<br>
<br>
  //rotate it so that it is aligned with the plane defined by vector &#39;plane&#39;<br>
  CubitVector current_plane(0,0,1);<br>
  CubitVector axis_of_rotation = current_plane * plane;<br>
  double angle_of_rotation = axis_of_rotation.vector_angle(<br>
current_plane, plane );<br>
<br>
  OCCQueryEngine::instance()-&gt;rotate( sheet_body, axis_of_rotation,<br>
RADIANS_TO_DEGREES(angle_of_rotation) );<br>
<br>
  return CUBIT_SUCCESS;<br>
}<br>
<br>
Curve* OCCModifyEngine::make_elliptical_Curve( TBPoint const* point1,<br>
<br>
 TBPoint const* point2,<br>
<br>
 CubitVector &amp;center_point,<br>
<br>
 double start_angle,<br>
<br>
 double end_angle,<br>
<br>
 CubitSense sense) const<br>
{<br>
  GeometryType curve_type = ELLIPSE_CURVE_TYPE;<br>
  Curve *curve = make_Curve(curve_type, point1, point2, &amp;center_point, sense );<br>
  if ( curve == NULL )<br>
  {<br>
    PRINT_ERROR(&quot;In OCCModifyEngine::make_elliptical_Curve\n&quot;<br>
                &quot;       Cannot make Curve object.\n&quot;);<br>
    return (Curve *)NULL;<br>
  }<br>
  return curve;<br>
}<br>
<br>
CubitStatus OCCModifyEngine::create_circle_surface( TBPoint *pt1,<br>
<br>
        CubitVector center_point,<br>
<br>
        TBPoint *pt3,<br>
<br>
        BodySM *&amp;sheet_body) const<br>
{<br>
  TBPoint *tmp_pt = OCCModifyEngine::instance()-&gt;make_Point( center_point );<br>
  Curve *circle = OCCModifyEngine::instance()-&gt;create_arc_three( pt1,<br>
tmp_pt, pt3, CUBIT_TRUE );<br>
<br>
  OCCQueryEngine::instance()-&gt;delete_solid_model_entities( tmp_pt );<br>
<br>
  DLIList&lt;Curve*&gt; curve_list(1);<br>
  curve_list.append( circle );<br>
  Surface *tmp_surface = OCCModifyEngine::instance()-&gt;make_Surface(<br>
PLANE_SURFACE_TYPE, curve_list, NULL, false );<br>
  if( NULL == tmp_surface )<br>
    return CUBIT_FAILURE;<br>
<br>
  sheet_body = OCCModifyEngine::instance()-&gt;make_BodySM( tmp_surface );<br>
  if( NULL == sheet_body)<br>
    return CUBIT_FAILURE;<br>
<br>
  return CUBIT_SUCCESS;<br>
}<br>
<br>
CubitStatus OCCModifyEngine::create_circle_surface( TBPoint *pt1,<br>
<br>
        TBPoint *pt3,<br>
<br>
        CubitVector center_point,<br>
<br>
        BodySM *&amp;sheet_body) const<br>
{<br>
  TBPoint *tmp_center_pt =      OCCModifyEngine::instance()-&gt;make_Point(<br>
center_point );<br>
  CubitVector normal(0,0,0);<br>
  Curve *circle = OCCModifyEngine::instance()-&gt;create_arc_center_edge(<br>
tmp_center_pt, pt1, pt3, normal, CUBIT_DBL_MAX, CUBIT_TRUE );<br>
<br>
  if( NULL == circle )<br>
    return CUBIT_FAILURE;<br>
<br>
  OCCQueryEngine::instance()-&gt;delete_solid_model_entities( tmp_center_pt );<br>
<br>
  DLIList&lt;Curve*&gt; curve_list(1);<br>
  curve_list.append( circle );<br>
  Surface *tmp_surface = OCCModifyEngine::instance()-&gt;make_Surface(<br>
PLANE_SURFACE_TYPE, curve_list, NULL, false );<br>
  if( NULL == tmp_surface )<br>
    return CUBIT_FAILURE;<br>
<br>
  sheet_body = OCCModifyEngine::instance()-&gt;make_BodySM( tmp_surface );<br>
  if( NULL == sheet_body)<br>
    return CUBIT_FAILURE;<br>
<br>
  return CUBIT_SUCCESS;<br>
}<br>
<br>
CubitStatus OCCModifyEngine::create_circle_surface( double radius,<br>
<br>
        CubitVector plane,<br>
<br>
        BodySM *&amp;sheet_body) const<br>
{<br>
  CubitVector center_pt;<br>
  center_pt.set(0, 0, 0);<br>
  CubitVector pt2, pt3;<br>
  if (plane.x() &gt; 0 )<br>
  {<br>
    pt2.set( 0, radius, 0 );<br>
    pt3.set( 0, 0, radius);<br>
  }<br>
  else if (plane.y() &gt; 0)<br>
  {<br>
    pt2.set(radius, 0, 0);<br>
    pt3.set(0, 0, -radius);<br>
  }<br>
  else if (plane.z() &gt; 0)<br>
  {<br>
    pt2.set(radius, 0, 0);<br>
    pt3.set(0, radius, 0);<br>
  }<br>
  else<br>
  {<br>
    PRINT_ERROR(&quot;In OCCModifyEngine::create_circle_surface\n&quot;<br>
                &quot;       Invalid plane specified.\n&quot;);<br>
    return CUBIT_FAILURE;<br>
  }<br>
  CubitVector normal(plane.x(), plane.y(), plane.z());<br>
<br>
  TBPoint *tbpt1 = OCCModifyEngine::instance()-&gt;make_Point( center_pt );<br>
  TBPoint *tbpt2 = OCCModifyEngine::instance()-&gt;make_Point( pt2 );<br>
  TBPoint *tbpt3 = OCCModifyEngine::instance()-&gt;make_Point( pt3 );<br>
  Curve *circle = OCCModifyEngine::instance()-&gt;create_arc_center_edge(<br>
                               tbpt1, tbpt2, tbpt3, normal, radius,<br>
CUBIT_DBL_MAX, CUBIT_FALSE);<br>
<br>
  DLIList&lt;Curve*&gt; curve_list(1);<br>
  curve_list.append( circle );<br>
  Surface *tmp_surface = OCCModifyEngine::instance()-&gt;make_Surface(<br>
PLANE_SURFACE_TYPE, curve_list, NULL, false );<br>
  if( NULL == tmp_surface )<br>
    return CUBIT_FAILURE;<br>
<br>
  sheet_body = OCCModifyEngine::instance()-&gt;make_BodySM( tmp_surface );<br>
  if( NULL == sheet_body)<br>
    return CUBIT_FAILURE;<br>
<br>
  return CUBIT_SUCCESS;<br>
<br>
}<br>
</blockquote></div><br>