[cgma-dev] errors with OCC
Leidy Suarez
ly.suarez at ingeciber.com
Thu Nov 20 06:03:08 CST 2008
Hi,
1. And another bug in line 73 in file: "OCCDrawTool.cpp" :
OCCSurface *occ_face = CAST_TO(occ_face, OCCSurface);
Maybe is:
OCCSurface *occ_face = CAST_TO(face, OCCSurface);
2. We have tried using "OCCDrawTool". The example is:
//======================== create objects
======================================
//Create sphere
RefEntity* sphereEnt= GeometryModifyTool::instance()->sphere(1.5);
sphereEnt->entity_name("sphere");
//========================================================================
//======================== Plot objects
======================================
TopoDS_CompSolid* objOCC;
int numBodies = GeometryQueryTool::instance()->num_bodies();
Body* tmpBd = GeometryQueryTool::instance()->get_first_body();
for (int i = 0; i < numBodies; i++)
{
BodySM* tmpBdSM = tmpBd->get_body_sm_ptr();
objOCC = ( (OCCBody*) tmpBdSM )->get_TopoDS_Shape();
//Opencascade Object
OCCDrawTool::instance()->draw_TopoDS_Shape(objOCC, 200);
tmpBd = GeometryQueryTool::instance()->get_next_body();
}
//========================================================================
We have had a problem when the method "draw_TopoDS_Shape" in the calling
of the method "draw_FACE".
The problem is exactly in the method "draw_FACE", when is called the
method "draw_curve". Because in "get_graphics" the
"facets" are not generated.
We have added the check:
//====================
if (facets.IsNull())
return CUBIT_FAILURE;
//====================
Why do you use the "BRep_Tool::Polygon3D" ?
Mahy thanks,
Leidy
Leidy Suarez wrote:
> Hi,
> We believe have found a problem using OCC engine.
>
> We have made an example. The example consist on create a arc circle
> passing two vertexes and one mid point.
>
> The code is showed to be continued.
>
> //====================== Create circle
> ======================================
> CubitVector v1(6.0, 0.0, 0.0);
> RefVertex* vert1 = GeometryModifyTool::instance()->make_RefVertex(v1);
> CubitVector v2(6.0, 8.0, 0.0);
> RefVertex* vert2 = GeometryModifyTool::instance()->make_RefVertex(v2);
> CubitVector v3(0, 8.0, 0.0);
> RefEdge* edge =
> GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, vert1,
> vert2, &v3, CUBIT_FORWARD );
>
> //===========================================================================
>
>
> The problem is when we have checked the vertexes that contain the
> curve. We have checked by two manners:
>
> 1. The first check is made by listing the vertexes using the vertex
> method called "get_child_ref_entities()" :
>
> //============================= List objects
> ==================================
> DLIList<RefEntity*> listVertexEdge;
> tmpEdge->get_child_ref_entities(listVertexEdge);
> int numVertexEdge = listVertexEdge.size();
> for (int i = 0; i < numVertexEdge; i++)
> {
> tmpVertex = (RefVertex*) listVertexEdge.get_and_step();
> tmpPt = tmpVertex->get_point_ptr();
> coord = tmpPt->coordinates();
> }
>
> //=============================================================================
>
> The result is:
>
> /The num total of vertexes of the arc curve are: 2
> The vertexes //coordinates //are: v1[6.0, 0.0, 0.0] and v2[0, 8.0, 0.0].
> /
> The questions is: /
>
> Why does not vert2 appear?./
>
> 2. The second check is made by listing the vertexes using the
> "GeometryQueryTool" tool:
>
> //============================= List objects
> ===================================
> int numTotalVertex =
> GeometryQueryTool::instance()->num_ref_vertices();
> RefVertex* tmpVertex = NULL;
> CubitVector coord;
> Point* tmpPt = NULL;
> for (int i = 0; i < numTotalVertex; i++)
> {
> tmpVertex = GeometryQueryTool::instance()->get_next_ref_vertex();
> tmpPt = tmpVertex->get_point_ptr();
> coord = tmpPt->coordinates();
> }
>
> //===========================================================================
>
>
> The result is:
>
> /The num total of vertexes are: 4
> The vertexes //coordinates //are: /v1(6.0, 0.0, 0.0), v2(6.0, 8.0,
> 0.0), v3(0, 8.0, 0.0)
> and v4(6.0, 0.0, 0.0).
>
> The questions is: /
>
> Why did v1 be repeated?.
>
>
> /Thanks,
> Leidy
>
>
More information about the cgma-dev
mailing list