X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FGEOM%2Frepairing_operations.htm;h=9f9bfafdc71aa74bba4ff747df93073cd48847ad;hb=8b2c3f9091f80920a901ebed502652cd8581ff4e;hp=2b48c28519226d8805c28b31609ed7b46ee3363b;hpb=3e9d56c09b4bb1f34cf25c95613ef7e12890a8cd;p=modules%2Fgeom.git diff --git a/doc/salome/gui/GEOM/repairing_operations.htm b/doc/salome/gui/GEOM/repairing_operations.htm index 2b48c2851..9f9bfafdc 100755 --- a/doc/salome/gui/GEOM/repairing_operations.htm +++ b/doc/salome/gui/GEOM/repairing_operations.htm @@ -34,43 +34,48 @@ onerror = null; - - + +

Repairing Operations

Shape Processing

@@ -83,7 +88,7 @@ else

 

-

# create vertices, edge, arc, wire, face and prism

+

# create vertices, an edge, an arc, a wire, a face and a prism

p1 = geompy.MakeVertex(0,0,0)

@@ -106,7 +111,7 @@ else

 

-

# check shape at the beginning

+

# check the shape at the beginning

print "Before ProcessShape:"

@@ -125,7 +130,7 @@ else

 

-

# process Shape

+

# process the Shape

Operators = ["FixShape"]

@@ -138,7 +143,7 @@ else

 

-

# check shape at the end

+

# check the shape at the end

print "After ProcessShape:"

@@ -160,7 +165,7 @@ else

 

-

# add in study and display

+

# add in the study and display

Id_Shape = geompy.addToStudy(theShape, "Invalid Shape")

@@ -189,14 +194,14 @@ else

 

-

# create box

+

# create a box

box = geompy.MakeBoxDXDYDZ(200, 200, 200)

 

-

# IDList for suppress faces

+

# The list of IDs (IDList) for suppress faces

sup_faces = []

@@ -205,7 +210,7 @@ else

 

-

# get sub-shape indexes

+

# get indices of the sub-shape

f1_id = geompy.GetSubShapeID(box, sup_faces[3])

@@ -219,7 +224,7 @@ else

 

-

# add objects in study

+

# add objects in the study

id_box = geompy.addToStudy(box, "Box")

@@ -229,7 +234,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_box)

@@ -281,14 +286,14 @@ else

  

-

# create arc

+

# create an arc

arc = geompy.MakeArc(py1, pz, px)

 

-

# create wire

+

# create a wire

wire = geompy.MakeWire([vxy, arc])

@@ -302,7 +307,7 @@ else

 

-

# add objects in study

+

# add objects in the study

id_wire = geompy.addToStudy(wire, "Wire")

@@ -312,7 +317,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_wire)

@@ -331,7 +336,7 @@ else

 

-

# create vertex and vector

+

# create a vertex and a vector

p1 = geompy.MakeVertex(55, 65, 50)

@@ -344,7 +349,7 @@ else

 

-

# create cylinder

+

# create a cylinder

height = 100

@@ -355,14 +360,14 @@ else

 

-

# create box

+

# create a box

box = geompy.MakeBoxDXDYDZ(100, 100, 100)

 

-

# make cut

+

# make a cut

cut = geompy.MakeCut(box, cylinder)

@@ -376,7 +381,7 @@ else

 

-

# add objects in study

+

# add objects in the study

id_cut = geompy.addToStudy(cut, "Cut")

@@ -386,7 +391,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_cut)

@@ -409,7 +414,7 @@ else

 

-

# create vertex and vector

+

# create a vertex and a vector

p1 = geompy.MakeVertex(35, 35, 0)

@@ -422,7 +427,7 @@ else

 

-

# create cylinder

+

# create a cylinder

height = 20

@@ -433,14 +438,14 @@ else

 

-

# create cone

+

# create a cone

cone = geompy.MakeCone(p1, v, 70, 0, 80)

 

-

# make cut

+

# make a cut

cut = geompy.MakeCut(cone, cylinder)

@@ -485,7 +490,7 @@ else

 

-

# add objects in study

+

# add objects in the study

id_cut = geompy.addToStudy(cut, "Cut")

@@ -498,7 +503,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_cut)

@@ -578,7 +583,7 @@ else

 

-

# add objects in study

+

# add objects in the study

id_face = geompy.addToStudy(face, "Face")

@@ -591,7 +596,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_face)

@@ -610,94 +615,74 @@ else

Glue Faces

-

import geompy

+

import + geompy

import salome

-

import math

- -

gg = salome.ImportComponentGUI("GEOM")

-

 

-

# create base points

- -

px = geompy.MakeVertex(100., - 0., 0.)

- -

py = geompy.MakeVertex(0., - 100., 0.)

- -

pz = geompy.MakeVertex(0., - 0., 100.)

+

gg = salome.ImportComponentGUI("GEOM")

 

-

# create base geometry - 2D & 3D

+

# create boxes

-

vector = geompy.MakeVector(px, - py)

+

box1 = geompy.MakeBox(0,0,0,100,50,100)

-

arc = geompy.MakeArc(py, - pz, px)

+

box2 = geompy.MakeBox(100,0,0,250,50,100)

 

-

# create base objects

- -

angle = 45. * math.pi - / 180

- -

WantPlanarFace = 1 - #True

- -

wire = geompy.MakeWire([vector, - arc])

- -

face = geompy.MakeFace(wire, - WantPlanarFace)

+

# make compound

-

face_rot = geompy.MakeRotation(face, - vector, angle)

+

compound = geompy.MakeCompound([box1, + box2])

 

-

# make sewing

+

# glue compound's faces

-

precision = 0.00001

+

tolerance = 1e-5

-

sewing = geompy.MakeSewing([face, - face_rot], precision)

+

glue = geompy.MakeGlueFaces(compound, + tolerance)

 

# add objects in study

-

id_face = geompy.addToStudy(face, - "Face")

+

id_box1 = geompy.addToStudy(box1, + "Box1")

-

id_face_rot = geompy.addToStudy(face_rot, - "Face rotation")

+

id_box2 = geompy.addToStudy(box2, + "Box2")

-

id_sewing = geompy.addToStudy(sewing, - "Sewing")

+

id_compound = geompy.addToStudy(compound, + "Compound")

+ +

id_glue = geompy.addToStudy(glue, + "Glue faces")

 

# display results

-

gg.createAndDisplayGO(id_face)

+

gg.createAndDisplayGO(id_box1)

-

gg.setDisplayMode(id_face,1)

+

gg.setDisplayMode(id_box1,1)

-

gg.createAndDisplayGO(id_face_rot)

+

gg.createAndDisplayGO(id_box2)

-

gg.setDisplayMode(id_face_rot,1)

+

gg.setDisplayMode(id_box2,1)

-

gg.createAndDisplayGO(id_sewing)

+

gg.createAndDisplayGO(id_compound)

-

gg.setDisplayMode(id_sewing,1) +

gg.setDisplayMode(id_compound,1)

+ +

gg.createAndDisplayGO(id_glue)

+ +

gg.setDisplayMode(id_glue,1)

 

@@ -719,21 +704,22 @@ else

 

-

# make edge

+

# make an edge

edge = geompy.MakeEdge(p1, p2) #geompy.GetSubShape(box, edge_ind)

 

-

# divide edge

+

# divide an edge

divide = geompy.DivideEdge(edge, -1, 0.5, 0)

 

-

# add objects in study

+

# add objects in the + study

id_edge = geompy.addToStudy(edge, "Edge")

@@ -768,6 +754,8 @@ else

Check Free Boundaries

+

import os

+

import geompy

import salome

@@ -784,7 +772,7 @@ else

 

-

# make compound

+

# make a compound

compound = geompy.MakeCompound([box1, box2])

@@ -793,19 +781,20 @@ else

# import from *.brep

-

ImportBREP = geompy.ImportBREP("/tmp/flight_solid.brep")

+

ImportBREP = geompy.ImportBREP("os.getenv("DATA_DIR")+"/Shapes/Brep/flight_solid.brep")

 

-

# get face

+

# get a face

faces = geompy.SubShapeAllSorted(ImportBREP, geompy.ShapeType["FACE"])

 

-

# get free boundary for - face 32

+

# get the free boundary + for face 32

Res = geompy.GetFreeBoundary(faces[32])

@@ -872,8 +861,8 @@ else

 

-

# get free boundary for - face 41

+

# get the free boundary + for face 41

Res = geompy.GetFreeBoundary(faces[41])

@@ -940,8 +929,8 @@ else

        

-

# add imported object - in study

+

# add the imported object + to the study

id_ImportBREP = geompy.addToStudy(ImportBREP, "ImportBREP")

@@ -961,7 +950,7 @@ else

 

-

# create vertex and vector

+

# create a vertex and a vector

p1 = geompy.MakeVertex(35, 35, 0)

@@ -974,14 +963,14 @@ else

 

-

# create cylinder

+

# create a cylinder

cylinder = geompy.MakeCone(p1, v, 30, 20, 20)

 

-

# create cone

+

# create a cone

cone = geompy.MakeCone(p1, v, 70, 40, 60)

@@ -1014,7 +1003,7 @@ else

 

-

# suppress specified wire

+

# suppress the specified wire

result = geompy.GetFreeFacesIDs(cut_without_f_2)

@@ -1023,7 +1012,7 @@ else

 

-

# add objects in study

+

# add objects in the study

all_faces = geompy.SubShapeAllSorted(cut_without_f_2, geompy.ShapeType["FACE"])

@@ -1052,7 +1041,7 @@ else

 

-

# display results

+

# display the results

gg.createAndDisplayGO(id_cut_without_f_2)