[cgma-dev] Seg fault when loading OCC geometry with associations

Jiangtao Hu jiangtao_ma at yahoo.com
Mon Mar 30 10:35:22 CDT 2009


I debugged on the read brep file part of code, and has an update for OCCShapeAttributeSet.cpp. It's now read in all geometry and attributes successfully.

Please update and see if your problem get cleared out some.

Jane


--- On Mon, 3/30/09, Jiangtao Hu <jiangtao_ma at yahoo.com> wrote:

> From: Jiangtao Hu <jiangtao_ma at yahoo.com>
> Subject: Re: [cgma-dev] Seg fault when loading OCC geometry with associations
> To: "Developer information for cgma" <cgma-dev at lists.mcs.anl.gov>
> Date: Monday, March 30, 2009, 10:47 AM
> I downloaded the two brep files that you provided and tried
> to open it using SALOME (www.salome-platform.org), a
> software that helps visualize brep file. Both files get
> segmentation violations when loading. 
> 
> So either the iGeom_Save didn't report the wrong doing,
> or your source code didn't associate it correctly.
> 
> I did the OCC geometry part of code, and the code for mesh
> set part when associate with OCC geometry is new to me. If
> you will provide the steps you did or your source code on
> utilizing OCC geometry with your mesh set, it'll help me
> debug on this.
> 
> Jane
> 
> --- On Sat, 3/28/09, Jed Brown <jed at 59A2.org> wrote:
> 
> > From: Jed Brown <jed at 59A2.org>
> > Subject: Re: [cgma-dev] Seg fault when loading OCC
> geometry with associations
> > To: cgma-dev at lists.mcs.anl.gov
> > Date: Saturday, March 28, 2009, 4:13 PM
> > On Sat 2009-03-28 12:47, Jiangtao Hu wrote:
> > 
> > > When you save the geometry file, it crashed,
> which
> > means the brep file
> > > you get may already been wrong. That explained
> the
> > crash when you load
> > > it again.
> > 
> > When I saved the geometry, iGeom_save returned
> success, so
> > I don't think
> > there was a crash there.
> > 
> > > Can you send a journal file to demonstrate the
> first
> > crash? 
> > 
> > What journal file?  I'm creating the geometry
> using
> > iGeom so it's source
> > code.  The snippet that creates the geometry is below.
> 
> > When
> > (assoc_with_brick==1) my relation testing code
> successfully
> > loads the
> > geometry, but the boundary sets 'facesets' end
> up
> > being associated with
> > points instead of the volume.  The geometry file for
> this
> > case is
> > 'dblock-assoc_with_brick.brep'.  When
> > (assoc_with_brick==0) I get the
> > seg-fault in iGeom_load (trace in my last message). 
> The
> > geometry file
> > for this case is 'dblock.brep'.
> > 
> > I can send you a full test case if necessary, but my
> > current code uses
> > utilities from my analysis code so it will take a
> little
> > work to make it
> > stand alone.
> > 
> > Jed
> > 
> > 
> >   if (do_geom) {
> >     char geom_options[] = "ENGINE=OCC:",
> >       geom_save_options[] = ":TYPE=OCC:";
> >     iGeom_Instance geom;
> >     iRel_Instance assoc;
> >     iRel_RelationHandle rel;
> >     iBase_EntityHandle brick;
> >    
> iGeom_newGeom(geom_options,&geom,&err,sizeof
> > geom_options);dIGCHK(geom,err);
> >    
> >
> iRel_newAssoc(0,&assoc,&err,0);dIRCHK(assoc,err);
> >    
> >
> iRel_createAssociation(assoc,geom,0,iRel_IGEOM_IFACE,mesh,1,iRel_IMESH_IFACE,&rel,&err);dIGCHK(assoc,err);
> >    
> >
> iGeom_createBrick(geom,box.x1-box.x0,box.y1-box.y0,box.z1-box.z0,&brick,&err);dIGCHK(geom,err);
> >    
> >
> iGeom_moveEnt(geom,brick,0.5*(box.x0+box.x1),0.5*(box.y0+box.y1),0.5*(box.z0+box.z1),&err);dIGCHK(geom,err);
> >     err =
> >
> PrintBoundingBox(geom,brick,"brick");dCHK(err);
> >     {
> >       iBase_EntityHandle gface[6],*gface_p=gface;
> >       int gface_a=6,gface_s;
> >      
> >
> iGeom_getEntAdj(geom,brick,2,&gface_p,&gface_a,&gface_s,&err);dIGCHK(geom,err);
> >       for (i=0; i<6; i++) {
> >         char name[20];
> >         sprintf(name,"face_%d",i);
> >         err =
> > PrintBoundingBox(geom,gface[i],name);dCHK(err);
> >       }
> >       if (assoc_with_brick) {
> >         for (i=0; i<6; i++) {
> >          
> >
> iRel_setEntSetAssociation(assoc,rel,brick,facesets[i],&err);dIRCHK(assoc,err);
> >         }
> >       } else {
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[0],facesets[3],&err);dIRCHK(assoc,err);
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[1],facesets[1],&err);dIRCHK(assoc,err);
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[2],facesets[0],&err);dIRCHK(assoc,err);
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[3],facesets[2],&err);dIRCHK(assoc,err);
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[4],facesets[4],&err);dIRCHK(assoc,err);
> >        
> >
> iRel_setEntSetAssociation(assoc,rel,gface[5],facesets[5],&err);dIRCHK(assoc,err);
> >       }
> >     }
> >    
> >
> iGeom_save(geom,outgeom,geom_save_options,&err,sizeof
> > outgeom,sizeof geom_save_options);dIGCHK(geom,err);
> >     iGeom_dtor(geom,&err);dIGCHK(geom,err);
> >     iRel_dtor(assoc,&err);dIRCHK(assoc,err);
> >   }


      


More information about the cgma-dev mailing list