View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000578 | Community | OCCT:Modeling Algorithms | public | 2002-08-01 17:01 | 2011-12-15 17:54 |
Reporter | Assigned To | ||||
Priority | none | Severity | trivial | ||
Status | closed | Resolution | fixed | ||
OS | All | ||||
Fixed in Version | 5.1.3 | ||||
Summary | 0000578: Bug in BRepClass3d_SolidClassifier | ||||
Description | This bug has been added by John Swanson at http://www.opencascade.org/forumorg/bug.php?bug_id=69&status=1 . Using the latest (as of yesterday) CVS update. The following snippet of code demonstrates the bug. The point "test_point" as shown by the sphere is clearly within the sub_etch1 shape, yet the SolidClassifier reports that it is not. Code snippet follows: void CSampleTopologicalOperationsDoc::OnTestShape2() { gp_Pnt P0(0,0,0.0); double xperiod = 1.0; double yperiod = 1.0; double sub_thick = 0.5; myAISContext->EraseAll(Standard_False); // mask_substrate TopoDS_Shape substrate = BRepPrimAPI_MakeBox( P0, xperiod, yperiod, sub_thick ); // -------------------------------------------------------------------- // wedge TopoDS_Shape wedge1 = BRepPrimAPI_MakeWedge(0.5, 0.05, 0.5, 0.1, 0.1 , 0.4, 0.4 ); gp_Trsf rotate = gce_MakeRotation ( gp_Pnt(0.0,0.0,0.0), gp_Dir(1.0,0.0,0.0), 1.570795 ); gp_Trsf translate = gce_MakeTranslation( gp_Pnt( 0.0, -0.5, 0.0), gp_Pnt( 0.25, 0.25, 0.5) ); rotate.PreMultiply( translate ); TopoDS_Shape wedge1a = BRepBuilderAPI_Transform( wedge1, rotate ); // -------------------------------------------------------------------- // wedge top TopoDS_Shape wedge2 = BRepPrimAPI_MakeWedge(0.5, 0.3, 0.5, 0.1, 0.1 , 0.4, 0.4 ); gp_Trsf rotate2 = gce_MakeRotation ( gp_Pnt(0.0,0.0,0.0), gp_Dir(1.0,0.0,0.0), 1.570795 * 3.0 ); gp_Trsf translate2 = gce_MakeTranslation( gp_Pnt( 0.0, 0.0, 0.0), gp_Pnt( 0.25, 0.25, 0.5) ); rotate2.PreMultiply( translate2 ); TopoDS_Shape wedge2a = BRepBuilderAPI_Transform( wedge2, rotate2 ); // combine wedges TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a); // remove wedge area from substrate TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common); // -------------------------------------------------------------------- // make deposit layer gp_Pnt P1(0,0,sub_thick); double deposit_thick = 0.2; TopoDS_Shape dep_layer = BRepPrimAPI_MakeBox( P1, xperiod, yperiod, deposit_thick ); // cut out any intersection w/wedge TopoDS_Shape dep_layer1 = BRepAlgoAPI_Cut(dep_layer, wedge_common); // --------------------------------------------------------------------- // make a wedge/"line" box gp_Pln plane1( gp_Pnt(0,0,0), gp_Dir(0,-1,0) ); BRepBuilderAPI_MakePolygon poly; poly.Add( gp_Pnt(0.4,0,.5) ); poly.Add( gp_Pnt(0.6,0,.5) ); poly.Add( gp_Pnt(0.578,0,.75) ); poly.Add( gp_Pnt(0.422,0,.75) ); poly.Close(); TopoDS_Wire W1 = poly.Wire(); BRepBuilderAPI_MakeFace MKF1(plane1); MKF1.Add( W1 ); TopoDS_Face FP1 = MKF1.Face(); TopoDS_Wire wprof = BRepBuilderAPI_MakePolygon( gp_Pnt(0.0,0.0,0.0) , gp_Pnt(0.0,0.0,1.0) ); TopoDS_Shape boxa = BRepOffsetAPI_MakeEvolved(FP1, wprof, GeomAbs_Arc, Standard_True, Standard_True, Standard_True ); gp_Trsf translateb = gce_MakeTranslation( gp_Pnt( 0.0, 0.0, 0.0), gp_Pnt( 0.0, 1.0, 0.0) ); TopoDS_Shape boxa1 = BRepBuilderAPI_Transform( boxa, translateb ); // cut get common intersection of line and dep_layer1 TopoDS_Shape boxa2 = BRepAlgoAPI_Common(dep_layer1, boxa1); // -------------------------------------------------------------------- // create test point / sphere gp_Pnt test_point( 0.64, 0.92, 0.1 ); TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(test_point, .02 ); Handle (AIS_Shape) sphere = new AIS_Shape(theSphere); myAISContext->SetColor(sphere,Quantity_NOC_YELLOW ); myAISContext->SetMaterial(sphere,Graphic3d_NOM_DEFAULT ); myAISContext->SetTransparency(sphere,_DEF_TRANSPARENCY); myAISContext->SetDisplayMode(sphere,AIS_WireFrame); myAISContext->Display(sphere); // -------------------------------------------------------------------- // display everything Handle (AIS_Shape) ais5a = new AIS_Shape(sub_etch1); myAISContext->SetColor(ais5a,Quantity_NOC_BLUE1 ); myAISContext->SetMaterial(ais5a,Graphic3d_NOM_DEFAULT ); myAISContext->SetTransparency(ais5a,_DEF_TRANSPARENCY); myAISContext->Display(ais5a); // display wedge Handle (AIS_Shape) ais5b = new AIS_Shape(wedge_common); myAISContext->SetColor(ais5b,Quantity_NOC_RED1 ); myAISContext->SetMaterial(ais5b,Graphic3d_NOM_DEFAULT ); myAISContext->SetTransparency(ais5b,_DEF_TRANSPARENCY); myAISContext->Display(ais5b); // display top line Handle (AIS_Shape) ais5c = new AIS_Shape(boxa2); myAISContext->SetColor(ais5c,Quantity_NOC_GREEN ); myAISContext->SetMaterial(ais5c,Graphic3d_NOM_DEFAULT ); myAISContext->SetTransparency(ais5c,_DEF_TRANSPARENCY); myAISContext->Display(ais5c); Fit(); // --------------------------------------------------------------------- BRepClass3d_SolidClassifier sclass2(sub_etch1); sclass2.Perform( test_point, 0.01); TopAbs_State state2 = sclass2.State(); if (state2 == TopAbs_IN || state2 == TopAbs_ON) { AfxMessageBox( "TEST : Point is IN or ON substrate!!!", MB_OK ); } else { AfxMessageBox( "ERROR : Point is OUTSIDE substrate!!!", MB_OK ); } return; } | ||||
Tags | No tags attached. | ||||
Test case number | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2002-08-06 11:49 | bugmaster | Status | new => closed |
2002-08-06 11:49 | bugmaster | Resolution | @0@ => unable to reproduce |
2002-10-30 13:20 | bugmaster | OtherBugsDependingOnThis | => 582, 583, 584 |
2002-10-30 13:20 | bugmaster | Status | closed => @-1@ |
2002-10-30 13:20 | bugmaster | Resolution | unable to reproduce => @0@ |
2003-08-13 12:20 | bugmaster | Assigned To | bugmaster => skv |
2003-08-13 12:20 | bugmaster | Status | @-1@ => assigned |
2003-09-04 16:43 |
|
Status | assigned => resolved |
2003-09-04 18:14 | bugmaster | CC | => apv |
2003-09-08 17:48 |
|
CC | => aki |
2003-09-29 10:50 |
|
CC | => mkv |
2003-10-17 19:51 |
|
Status | resolved => tested |
2003-11-27 18:55 | bugmaster | Assigned To | skv => jgv |
2003-11-27 18:55 | bugmaster | Status | tested => assigned |
2004-04-06 12:08 | bugmaster | CC | => skv |
2004-04-06 12:08 | bugmaster | Status | assigned => tested |
2004-04-12 13:18 | bugmaster | Status | tested => verified |
2004-04-26 10:57 | bugmaster | Status | verified => closed |
2004-04-26 10:57 | bugmaster | Fixed in Version | => 5.1.3 |
2004-04-26 10:57 | bugmaster | Resolution | @0@ => fixed |
2011-08-02 11:31 | bugmaster | Category | OCCT:MOA => OCCT:Modeling Algorithms |
2011-12-15 17:54 | bugmaster | Project | Open CASCADE => Community |