sketcher3 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
isPlanarFace = 1
+sphere = geompy.MakeSphereR(100)
+box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+cut = geompy.MakeCutList(sphere, [box], True)
+
# create a face from the wire
face1 = geompy.MakeFace(wire, isPlanarFace)
face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
face4 = geompy.MakeFaceFromSurface(face1, sketcher1)
+# create face on wire with constraints
+face5 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(cut, [5]), geompy.GetSubShape(cut, [3]),
+ geompy.GetSubShape(cut, [11]), geompy.GetSubShape(cut, [3]),
+ geompy.GetSubShape(cut, [13]), geompy.GetSubShape(cut, [3])])
+
# add objects in the study
id_face1 = geompy.addToStudy(face1,"Face1")
id_face2 = geompy.addToStudy(face2,"Face2")
id_face3 = geompy.addToStudy(face3,"Face3")
id_face4 = geompy.addToStudy(face4,"Face4")
+id_face5 = geompy.addToStudy(face5,"Face5")
# display the faces
gg.createAndDisplayGO(id_face1)
gg.createAndDisplayGO(id_face4)
gg.setDisplayMode(id_face4,1)
gg.setTransparency(id_face4,0.2)
+gg.createAndDisplayGO(id_face5)
+gg.setDisplayMode(id_face5,1)
+gg.setTransparency(id_face5,0.2)
//=================================================================================
void BuildGUI_FaceDlg::SelectionIntoArgument()
{
+ erasePreview();
if( myEditCurrentArgument == myGroupWire->LineEdit1 ) {
myEditCurrentArgument->setText("");
myCurrentItem->setFace( aSelectedObject );
findEmptyTreeItem();
}
- else
+ else {
myCurrentItem->setFace(NULL);
+ displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED);
+ }
}
else {
myWire.nullify();
}
}
}
- //displayPreview(true);
+ displayPreview(true, false, true, true, -1, -1, -1, true);
}
return;
myCurrentItem = dynamic_cast<BuildGUI_TreeWidgetItem*>( theItem );
- erasePreview();
+ displayPreview( true );
displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED);
}
int j = 0;
for( int i = 0; i < numberOfItems; i++ ) {
BuildGUI_TreeWidgetItem* item = dynamic_cast<BuildGUI_TreeWidgetItem*>( myTreeConstraints->topLevelItem(i) );
- constraints[j++] = item->getEdge().get();
+ constraints[j++] = GEOM::GEOM_Object::_duplicate(item->getEdge().get());
if ( item->getFace() )
- constraints[j++] = item->getFace().get();
+ constraints[j++] = GEOM::GEOM_Object::_duplicate(item->getFace().get());
}
constraints->length(j);
anObj = anOper->MakeFaceWithConstraints( constraints.in() );
const bool toRemoveFromEngine,
const double lineWidth,
const int displayMode,
- const int color )
+ const int color,
+ const bool append )
{
if(!display) {
erasePreview( update );
return;
}
- erasePreview( false );
+ if( !append )
+ erasePreview( false );
try {
SUIT_OverrideCursor wc;
const bool toRemoveFromEngine = true,
const double lineWidth = -1,
const int displayMode = -1,
- const int color = -1 );
+ const int color = -1,
+ const bool append = false );
// This is the easiest way to show preview. It is based on execute() method.
// It removes temporary GEOM::GEOM_Objects automatically.
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object
Face4 = geompy.MakeFaceObjHW (vz, 200., 100.) #(1 GEOM_Object, 2 Doubles)->GEOM_Object
Face5 = geompy.MakeFaceFromSurface(Face, Sketcher) #(2 GEOM_Objects)->GEOM_Object
+
+ Cut2 = geompy.MakeCutList(Sphere1, [Box1], True)
+ #(List of GEOM_Object)->GEOM_Object
+ Face6 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(Cut2, [5]), geompy.GetSubShape(Cut2, [3]),
+ geompy.GetSubShape(Cut2, [11]), geompy.GetSubShape(Cut2, [3]),
+ geompy.GetSubShape(Cut2, [13]), geompy.GetSubShape(Cut2, [3])])
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object, 1 Double)->GEOM_Object
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object)->GEOM_Object
Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
id_Common = geompy.addToStudy(Common, "Common")
id_Cut = geompy.addToStudy(Cut, "Cut")
+ id_Cut2 = geompy.addToStudy(Cut2, "Cut2")
id_Fuse = geompy.addToStudy(Fuse, "Fuse")
id_Section = geompy.addToStudy(Section, "Section")
id_Face3 = geompy.addToStudy(Face3, "Face Height Width")
id_Face4 = geompy.addToStudy(Face4, "Face Plane_HW")
id_Face5 = geompy.addToStudy(Face5, "Face from surface and wire")
+ id_Face6 = geompy.addToStudy(Face6, "Face on wire with constraints")
id_Disk = geompy.addToStudy(Disk, "Disk PntVecR")
id_Disk2 = geompy.addToStudy(Disk2, "Disk Three Points")
id_Disk3 = geompy.addToStudy(Disk3, "Disk OXY Radius")