Feature for boundary vectors
This commit is contained in:
parent
7fce26a618
commit
2586acfa54
@ -41,7 +41,7 @@ class simpleCubic:
|
|||||||
#
|
#
|
||||||
R_0 = 1
|
R_0 = 1
|
||||||
R = R_0 / (1 - alpha)
|
R = R_0 / (1 - alpha)
|
||||||
R_fillet = 0.05
|
R_fillet = 0
|
||||||
|
|
||||||
# xyz axes
|
# xyz axes
|
||||||
axes = [
|
axes = [
|
||||||
@ -75,6 +75,8 @@ class simpleCubic:
|
|||||||
sphere3 = geompy.ExtractShapes(sphere3, geompy.ShapeType["SOLID"], True)
|
sphere3 = geompy.ExtractShapes(sphere3, geompy.ShapeType["SOLID"], True)
|
||||||
|
|
||||||
sphere = geompy.MakeFuseList(sphere + sphere2 + sphere3, True, True)
|
sphere = geompy.MakeFuseList(sphere + sphere2 + sphere3, True, True)
|
||||||
|
|
||||||
|
if not R_fillet == 0:
|
||||||
sphere = geompy.MakeFilletAll(sphere, R_fillet)
|
sphere = geompy.MakeFilletAll(sphere, R_fillet)
|
||||||
|
|
||||||
self.geometry = geompy.MakeCutList(box, [sphere], True)
|
self.geometry = geompy.MakeCutList(box, [sphere], True)
|
||||||
@ -213,7 +215,8 @@ class simpleCubic:
|
|||||||
|
|
||||||
planes = geompy.ExtractShapes(box, geompy.ShapeType["FACE"], True)
|
planes = geompy.ExtractShapes(box, geompy.ShapeType["FACE"], True)
|
||||||
|
|
||||||
vplanes = []
|
inletplane = None
|
||||||
|
outletplane = None
|
||||||
hplanes = []
|
hplanes = []
|
||||||
n = 0
|
n = 0
|
||||||
for plane in planes:
|
for plane in planes:
|
||||||
@ -222,39 +225,20 @@ class simpleCubic:
|
|||||||
geompy.addToStudy(planeNorm, "normalplane-{}".format(n))
|
geompy.addToStudy(planeNorm, "normalplane-{}".format(n))
|
||||||
angle = abs(geompy.GetAngle(planeNorm, norm))
|
angle = abs(geompy.GetAngle(planeNorm, norm))
|
||||||
logging.info("angle = {}".format(angle))
|
logging.info("angle = {}".format(angle))
|
||||||
if angle == 0 or angle == 180:
|
|
||||||
vplanes.append(plane)
|
if angle == 0:
|
||||||
|
outletplane = plane
|
||||||
|
|
||||||
|
elif angle == 180:
|
||||||
|
inletplane = plane
|
||||||
|
|
||||||
else:
|
else:
|
||||||
hplanes.append(plane)
|
hplanes.append(plane)
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
logging.info(len(vplanes))
|
|
||||||
logging.info(len(hplanes))
|
|
||||||
|
|
||||||
if direction == "001":
|
logging.info("hplanes = {}".format(len(hplanes)))
|
||||||
z1 = geompy.GetPosition(vplanes[0])[3]
|
|
||||||
z2 = geompy.GetPosition(vplanes[1])[3]
|
|
||||||
|
|
||||||
if z1 > z2:
|
|
||||||
inletplane = vplanes[0]
|
|
||||||
outletplane = vplanes[1]
|
|
||||||
|
|
||||||
else:
|
|
||||||
inletplane = vplanes[1]
|
|
||||||
outletplane = vplanes[0]
|
|
||||||
|
|
||||||
elif direction == "100" or direction == "111":
|
|
||||||
x1 = geompy.GetPosition(vplanes[0])[1]
|
|
||||||
x2 = geompy.GetPosition(vplanes[1])[1]
|
|
||||||
logging.info("x1 = {}, x2 = {}".format(x1, x2))
|
|
||||||
if x1 > x2:
|
|
||||||
inletplane = vplanes[0]
|
|
||||||
outletplane = vplanes[1]
|
|
||||||
|
|
||||||
else:
|
|
||||||
inletplane = vplanes[1]
|
|
||||||
outletplane = vplanes[0]
|
|
||||||
|
|
||||||
|
|
||||||
# inlet and outlet
|
# inlet and outlet
|
||||||
|
Loading…
Reference in New Issue
Block a user