[cgma-dev] Why can't I create surfaces from curves

Vander Zee, Evan B. vanderzee at anl.gov
Tue Jul 28 11:21:23 CDT 2015


Andy,

I reproduced your problem using a version of CGM that I built on Cubit13.1.  After some experimentation, I think that the problem is that the GeometryType is off by one in CGMA from what the Cubit library expects.  I got successful RefFaces when passing arguments CONE_SURFACE_TYPE (which I am guessing is interpreted as the one-later enum value PLANE_SURFACE_TYPE) and TORUS_SURFACE_TYPE (which I am guessing is interpreted as the one-later enum value BEST_FIT_SURFACE_TYPE).

We ought to fix the off-by-one error, but for now just the information I’ve given will probably help you with whatever you are doing.

I’m not sure which value would have to be removed/renumbered to get CGMA to agree with Cubit.  Is anyone else familiar with the GeometryType enumeration?  I’m just making my best guess here . . .

-Evan

From: Vander Zee, Evan B.
Sent: Monday, July 27, 2015 4:48 PM
To: cgma-dev at mcs.anl.gov
Cc: Patrick Shriwise; 'Andrew Davis'
Subject: RE: [cgma-dev] Why can't I create surfaces from curves

It is a little hard to tell exactly what you are trying to do, but it looks like you are trying to create a circular patch in the y-z plane.  I tried running the code you provided with OCC geometry engine, and I got no errors.

Some things you could try would be giving more than two edges and linking edges better in a loop, i.e., making sure that the end vertex of one edge is the beginning vertex of the next.  I planned to try these, but my only successful build of CGM with acis so far is a cmake build, and I’m still a novice in the cmake build system, so I didn’t get far enough to reproduce the problem.  What version are you using?

-Evan

From: cgma-dev-bounces at mcs.anl.gov<mailto:cgma-dev-bounces at mcs.anl.gov> [mailto:cgma-dev-bounces at mcs.anl.gov] On Behalf Of Andrew Davis
Sent: Monday, July 27, 2015 10:01 AM
To: Patrick Shriwise
Cc: Andrew Davis; cgma-dev at mcs.anl.gov<mailto:cgma-dev at mcs.anl.gov>
Subject: Re: [cgma-dev] Why can't I create surfaces from curves

Hi Patrick

Irrespective of whether or not I use planar, best fit, sphere, its the same error message over and over again.

Thanks

Andy

On Sat, Jul 25, 2015 at 8:00 AM, Patrick Shriwise <shriwise at wisc.edu<mailto:shriwise at wisc.edu>> wrote:
Hey Andy,

The error message seems to indicate it's trying to make a surface which isn't planar.. maybe thats a good starting point? Are there other flags to hand that function by chance?

Cheers,

Patrick

On 07/23/2015 02:34 PM, Andrew Davis wrote:
Hi Guys

I have the following function that I've added to my version of iGeom,

ITAPS_API void
iGeom_createSurface2(iGeom_Instance instance,
   /*in*/ iBase_EntityHandle *input_curves,
   /*in*/ int num_curves,
   /*out*/ iBase_EntityHandle *geom_entity,
                    int* err)
{
  CubitVector p1(0, 0, 5);
  RefVertex* v1 = gmt->make_RefVertex(p1);

  CubitVector p2(0, 0, -5);
  RefVertex* v2 = gmt->make_RefVertex(p2);

  CubitVector p3(0, 5, 0);
  RefVertex* v3 = gmt->make_RefVertex(p3);

  CubitVector p4(0, -5, 0);
  RefVertex* v4 = gmt->make_RefVertex(p4);

  RefEdge* e1 = gmt->make_RefEdge(ARC_CURVE_TYPE,v1,v2,&p3);
  RefEdge* e2 = gmt->make_RefEdge(ARC_CURVE_TYPE,v1,v2,&p4);

  DLIList<RefEdge*> curves;
  curves.insert(e1);
  curves.insert(e2);

  RefFace* tmp_surface =  gmt->make_RefFace(PLANE_SURFACE_TYPE,
   curves,
   false);

  *geom_entity = reinterpret_cast<iBase_EntityHandle>(tmp_surface);
  RETURN ((tmp_surface ? iBase_SUCCESS : iBase_FAILURE));
}

When I run this, I can sucessfully create the vertices, and create curves from those verts using make_RefEdge. When I try to create a surface from those two ref edges I get the following error.

WARNING: In AcisGeometryEngine::make_FACE
         At this time, cannot make a FACE that isn't planar or best fit.
ERROR: In AcisModifyEngine::make_Surface
       Cannot make Surface object.
ERROR: Couldn't make new RefFace.

If I save the file as acis and examine the results in Cubit, they appear as they should (minus the surface). I can, in Cubit, make surface then, sweep and do all the operations that I want to.

Is there something that I', just misunderstanding about CGM / gmt that means I'm using this wrong?

Thanks

Andy





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/cgma-dev/attachments/20150728/a814d66e/attachment-0001.html>


More information about the cgma-dev mailing list