[cgma-dev] errors with OCC
Jiangtao Hu
jiangtao_ma at yahoo.com
Tue Nov 18 14:35:39 CST 2008
Hi, Leidy
Thank you again for testing on OCC. Yes, both problems you reported are bugs, and have been fixed in the updated version of OCC codes. Please see below comments.
Jane
--- On Tue, 11/18/08, Leidy Suarez <ly.suarez at ingeciber.com> wrote:
From: Leidy Suarez <ly.suarez at ingeciber.com>
Subject: errors with OCC
To: jiangtao_ma at yahoo.com
Date: Tuesday, November 18, 2008, 7:16 AM
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?./
This is bug one, that the code used to use the first and third vertex (point)
to create an edge and the vert2 was treated as a middle point. You can verify
it by checking for the length of the edge you created, and it's a length of
half circle of radius 5. This has been corrected.
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?.
I believe if you do this check again, you will find the v1 and v3 be repeated
once and v2 not shown. This is the other bug that the code didn't reuse the
existing vertices, instead created new vertices which caused repetition. This
has been fixed too.
/Thanks,
Leidy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/cgma-dev/attachments/20081118/17de097b/attachment.htm>
More information about the cgma-dev
mailing list