About AIS_Triangulation

Alexmercer

CAD practitioner
I'm trying to display a Poly_Triangulation。I use AIS_ Triangulation to display the mesh

Handle(Poly_Triangulation) Tri = tris->GetTriangulation();
Handle(AIS_Triangulation) anAisTriangulation = new AIS_Triangulation(Tri);
Handle(AIS_Shape) anAISShape = new AIS_Shape(IgsShape);
//Handle(AIS_Shape) anAISShape = new AIS_Shape(aCompound);
anAISShape->SetColor(Quantity_NOC_BLACK);
anAISShape->SetDisplayMode(AIS_WireFrame/AIS_Shaded);

I use AIS_Shaded and AIS_WireFrame,But the results are very bad.
Then I use MeshVS_Mesh
Handle(XSDRAWSTLVRML_DataSource) aDS = new XSDRAWSTLVRML_DataSource(aTriangulation);
Handle(MeshVS_Mesh) aMesh = new MeshVS_Mesh();
aMesh->SetDataSource(aDS);

// use default presentation builder.
Handle(MeshVS_MeshPrsBuilder) Builder = new MeshVS_MeshPrsBuilder(aMesh.operator->());
aMesh->AddBuilder(Builder, TRUE);

aMesh->SetDisplayMode(MeshVS_DMF_Shading);
aMesh->SetMeshSelMethod(MeshVS_MSM_PRECISE);
aMesh->SetHilightMode(MeshVS_DMF_Shading);
aMesh->SetTransparency(0.4);
aMesh->SetColor(Quantity_NOC_GOLD);
H_Aiscontext->Display(aMesh,Standard_True);
But nothing is shown.I don't know why
 

Attachments

  • AIS_WireFrame.png
    AIS_WireFrame.png
    12.6 KB · Views: 6
  • AIS_Shaded.png
    AIS_Shaded.png
    3.3 KB · Views: 6

JSlyadne

Administrator
Staff member
Is my understanding correct that shading representation is below your expectations? The wireframe looks Ok for me.

The code listing doesn't explain what "IgsShape" is. Could you please elaborate more on this?

Is it possible for you to attch the model itself?
 
Top