mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-26 09:20:35 +05:00
Merge V9_dev branch into master
This commit is contained in:
commit
4df93cfed7
@ -1,5 +1,4 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python3
|
||||||
# -*- coding: iso-8859-1 -*-
|
|
||||||
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@ -58,7 +57,7 @@ def set_env( args ):
|
|||||||
plugin_list.append("AdvancedGEOM")
|
plugin_list.append("AdvancedGEOM")
|
||||||
|
|
||||||
# find additional plugins
|
# find additional plugins
|
||||||
for env_var in os.environ.keys():
|
for env_var in os.environ:
|
||||||
value = os.environ[env_var]
|
value = os.environ[env_var]
|
||||||
if env_var[-9:] == "_ROOT_DIR" and value:
|
if env_var[-9:] == "_ROOT_DIR" and value:
|
||||||
plugin_root = value
|
plugin_root = value
|
||||||
@ -84,7 +83,7 @@ def set_env( args ):
|
|||||||
plugin_list.append(plugin)
|
plugin_list.append(plugin)
|
||||||
|
|
||||||
# add paths of plugin
|
# add paths of plugin
|
||||||
if not os.environ.has_key("SALOME_"+plugin+"Resources"):
|
if "SALOME_"+plugin+"Resources" not in os.environ:
|
||||||
resource_path = os.path.join(plugin_root, "share", salome_subdir, "resources", plugin.lower())
|
resource_path = os.path.join(plugin_root, "share", salome_subdir, "resources", plugin.lower())
|
||||||
os.environ["SALOME_"+plugin+"Resources"] = resource_path
|
os.environ["SALOME_"+plugin+"Resources"] = resource_path
|
||||||
resource_path_list.append(resource_path)
|
resource_path_list.append(resource_path)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# Create a 3D sketcher (wire) on the given points coordinates
|
# Create a 3D sketcher (wire) on the given points coordinates
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# a box
|
# a box
|
||||||
|
@ -5,7 +5,7 @@ salome.salome_init()
|
|||||||
# --- geom Python interface
|
# --- geom Python interface
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# --- Create a box and publish it into the salome study
|
# --- Create a box and publish it into the salome study
|
||||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
@ -13,4 +13,4 @@ geompy.addToStudy( Box_1, 'Box_1' )
|
|||||||
|
|
||||||
# --- update the study object browser
|
# --- update the study object browser
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create PipeTShape object
|
# create PipeTShape object
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create DividedDisk object
|
# create DividedDisk object
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create DividedCylinder object
|
# create DividedCylinder object
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import salome, GEOM
|
import salome, GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a could of points
|
# create a could of points
|
||||||
points = [
|
points = [
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
|
|
||||||
OX = geompy.MakeVectorDXDYDZ(10, 0,0)
|
OX = geompy.MakeVectorDXDYDZ(10, 0,0)
|
||||||
@ -13,39 +13,39 @@ OXY = geompy.MakeVectorDXDYDZ(10,10,0)
|
|||||||
# in one plane
|
# in one plane
|
||||||
Angle = geompy.GetAngle(OX, OXY)
|
Angle = geompy.GetAngle(OX, OXY)
|
||||||
|
|
||||||
print "\nAngle between OX and OXY = ", Angle
|
print("\nAngle between OX and OXY = ", Angle)
|
||||||
if math.fabs(Angle - 45.0) > 1e-05:
|
if math.fabs(Angle - 45.0) > 1e-05:
|
||||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Angle = geompy.GetAngleRadians(OX, OXY)
|
Angle = geompy.GetAngleRadians(OX, OXY)
|
||||||
|
|
||||||
print "\nAngle between OX and OXY in radians = ", Angle
|
print("\nAngle between OX and OXY in radians = ", Angle)
|
||||||
if math.fabs(Angle - math.pi/4) > 1e-05:
|
if math.fabs(Angle - math.pi/4) > 1e-05:
|
||||||
print " Error: returned angle is", Angle, "while must be pi/4"
|
print(" Error: returned angle is", Angle, "while must be pi/4")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Angle = geompy.GetAngleVectors(OX, OXY, True)
|
Angle = geompy.GetAngleVectors(OX, OXY, True)
|
||||||
|
|
||||||
print "\nAngle between vectors OX and OXY = ", Angle
|
print("\nAngle between vectors OX and OXY = ", Angle)
|
||||||
if math.fabs(Angle - 45.0) > 1e-05:
|
if math.fabs(Angle - 45.0) > 1e-05:
|
||||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Angle = geompy.GetAngleRadiansVectors(OX, OXY, False)
|
Angle = geompy.GetAngleRadiansVectors(OX, OXY, False)
|
||||||
|
|
||||||
print "\nBig angle between vectors OX and OXY in radians = ", Angle
|
print("\nBig angle between vectors OX and OXY in radians = ", Angle)
|
||||||
if math.fabs(Angle - math.pi*7./4.) > 1e-05:
|
if math.fabs(Angle - math.pi*7./4.) > 1e-05:
|
||||||
print " Error: returned angle is", Angle, "while must be 7*pi/4"
|
print(" Error: returned angle is", Angle, "while must be 7*pi/4")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# not in one plane
|
# not in one plane
|
||||||
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
|
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
|
||||||
Angle = geompy.GetAngle(OX, OXY_shift)
|
Angle = geompy.GetAngle(OX, OXY_shift)
|
||||||
|
|
||||||
print "\nAngle between OX and OXY_shift = ", Angle
|
print("\nAngle between OX and OXY_shift = ", Angle)
|
||||||
if math.fabs(Angle - 45.0) > 1e-05:
|
if math.fabs(Angle - 45.0) > 1e-05:
|
||||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# not linear
|
# not linear
|
||||||
|
@ -5,7 +5,7 @@ salome.salome_init()
|
|||||||
|
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
Circle_1 = geompy.MakeCircle(None, None, 100)
|
Circle_1 = geompy.MakeCircle(None, None, 100)
|
||||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
@ -22,4 +22,4 @@ geompy.PutListToFolder([Box_1, Cylinder_1], Primitives)
|
|||||||
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices and vectors
|
# create vertices and vectors
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
import SALOMEDS
|
import SALOMEDS
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
import SALOMEDS
|
import SALOMEDS
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import SALOMEDS
|
import SALOMEDS
|
||||||
|
|
||||||
# create a box and a cylinder
|
# create a box and a cylinder
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import SALOMEDS
|
import SALOMEDS
|
||||||
|
|
||||||
# create a box and partigion it by two planes
|
# create a box and partigion it by two planes
|
||||||
|
@ -4,21 +4,21 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
props = geompy.BasicProperties(box)
|
props = geompy.BasicProperties(box)
|
||||||
print "\nBox 100x30x100 Basic Properties:"
|
print("\nBox 100x30x100 Basic Properties:")
|
||||||
print " Wires length: ", props[0]
|
print(" Wires length: ", props[0])
|
||||||
print " Surface area: ", props[1]
|
print(" Surface area: ", props[1])
|
||||||
print " Volume : ", props[2]
|
print(" Volume : ", props[2])
|
||||||
length = math.sqrt((props[0] - 1840)*(props[0] - 1840))
|
length = math.sqrt((props[0] - 1840)*(props[0] - 1840))
|
||||||
area = math.sqrt((props[1] - 32000)*(props[1] - 32000))
|
area = math.sqrt((props[1] - 32000)*(props[1] - 32000))
|
||||||
volume = math.sqrt((props[2] - 300000)*(props[2] - 300000))
|
volume = math.sqrt((props[2] - 300000)*(props[2] - 300000))
|
||||||
if length > 1e-7 or area > 1e-7 or volume > 1e-7:
|
if length > 1e-7 or area > 1e-7 or volume > 1e-7:
|
||||||
print "While must be:"
|
print("While must be:")
|
||||||
print " Wires length: ", 1840
|
print(" Wires length: ", 1840)
|
||||||
print " Surface area: ", 32000
|
print(" Surface area: ", 32000)
|
||||||
print " Volume : ", 300000.
|
print(" Volume : ", 300000.)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box and a sphere
|
# create a box and a sphere
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
@ -16,8 +16,8 @@ listChains = geompy.Propagate(check_box)
|
|||||||
geompy.addToStudy(check_box, "Box")
|
geompy.addToStudy(check_box, "Box")
|
||||||
ii = 1
|
ii = 1
|
||||||
for chain in listChains:
|
for chain in listChains:
|
||||||
geompy.addToStudyInFather(check_box, chain, "propagation chain " + `ii`)
|
geompy.addToStudyInFather(check_box, chain, "propagation chain " + repr(ii))
|
||||||
ii = ii + 1
|
ii = ii + 1
|
||||||
pass
|
pass
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,16 +4,16 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
|
|
||||||
bb = geompy.BoundingBox(box)
|
bb = geompy.BoundingBox(box)
|
||||||
print "\nBounding Box of box 100x30x100:"
|
print("\nBounding Box of box 100x30x100:")
|
||||||
print " Xmin = ", bb[0], ", Xmax = ", bb[1]
|
print(" Xmin = ", bb[0], ", Xmax = ", bb[1])
|
||||||
print " Ymin = ", bb[2], ", Ymax = ", bb[3]
|
print(" Ymin = ", bb[2], ", Ymax = ", bb[3])
|
||||||
print " Zmin = ", bb[4], ", Zmax = ", bb[5]
|
print(" Zmin = ", bb[4], ", Zmax = ", bb[5])
|
||||||
|
|
||||||
aBB = geompy.MakeBoundingBox(box)
|
aBB = geompy.MakeBoundingBox(box)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,20 +4,20 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
cm = geompy.MakeCDG(box)
|
cm = geompy.MakeCDG(box)
|
||||||
if cm is None:
|
if cm is None:
|
||||||
raise RuntimeError, "MakeCDG(box) failed"
|
raise RuntimeError("MakeCDG(box) failed")
|
||||||
else:
|
else:
|
||||||
print "\nCentre of gravity of box has been successfully obtained:"
|
print("\nCentre of gravity of box has been successfully obtained:")
|
||||||
coords = geompy.PointCoordinates(cm)
|
coords = geompy.PointCoordinates(cm)
|
||||||
print "(", coords[0], ", ", coords[1], ", ", coords[2], ")"
|
print("(", coords[0], ", ", coords[1], ", ", coords[2], ")")
|
||||||
dx = math.sqrt((coords[0] - 50)*(coords[0] - 50))
|
dx = math.sqrt((coords[0] - 50)*(coords[0] - 50))
|
||||||
dy = math.sqrt((coords[1] - 15)*(coords[1] - 15))
|
dy = math.sqrt((coords[1] - 15)*(coords[1] - 15))
|
||||||
dz = math.sqrt((coords[2] - 50)*(coords[2] - 50))
|
dz = math.sqrt((coords[2] - 50)*(coords[2] - 50))
|
||||||
if dx > 1e-7 or dy > 1e-7 or dz > 1e-7:
|
if dx > 1e-7 or dy > 1e-7 or dz > 1e-7:
|
||||||
print "But must be (50, 15, 50)"
|
print("But must be (50, 15, 50)")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create boxes
|
# create boxes
|
||||||
@ -19,6 +19,6 @@ tolerance = 1e-5
|
|||||||
glue = geompy.MakeGlueFaces(compound, tolerance)
|
glue = geompy.MakeGlueFaces(compound, tolerance)
|
||||||
IsValid = geompy.CheckCompoundOfBlocks(glue)
|
IsValid = geompy.CheckCompoundOfBlocks(glue)
|
||||||
if IsValid == 0:
|
if IsValid == 0:
|
||||||
raise RuntimeError, "Invalid compound created"
|
raise RuntimeError("Invalid compound created")
|
||||||
else:
|
else:
|
||||||
print "\nCompound is valid"
|
print("\nCompound is valid")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||||
@ -16,6 +16,6 @@ compound = geompy.MakeCompound([box, cylinder])
|
|||||||
# check self-intersection
|
# check self-intersection
|
||||||
IsValid = geompy.CheckSelfIntersections(compound)
|
IsValid = geompy.CheckSelfIntersections(compound)
|
||||||
if not IsValid:
|
if not IsValid:
|
||||||
print "Shape is self-intersected!"
|
print("Shape is self-intersected!")
|
||||||
else:
|
else:
|
||||||
print "No self-intersection detected in a shape"
|
print("No self-intersection detected in a shape")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||||
@ -16,6 +16,6 @@ compound = geompy.MakeCompound([box, cylinder])
|
|||||||
# check self-intersection
|
# check self-intersection
|
||||||
IsValid = geompy.CheckSelfIntersectionsFast(compound)
|
IsValid = geompy.CheckSelfIntersectionsFast(compound)
|
||||||
if not IsValid:
|
if not IsValid:
|
||||||
print "Shape is self-intersected!"
|
print("Shape is self-intersected!")
|
||||||
else:
|
else:
|
||||||
print "No self-intersection detected in a shape"
|
print("No self-intersection detected in a shape")
|
||||||
|
@ -4,13 +4,13 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
(IsValid, err) = geompy.CheckShape(box, 0, 2)
|
(IsValid, err) = geompy.CheckShape(box, 0, 2)
|
||||||
if IsValid == 0:
|
if IsValid == 0:
|
||||||
geompy.PrintShapeErrors(box, err)
|
geompy.PrintShapeErrors(box, err)
|
||||||
raise RuntimeError, "Invalid box created"
|
raise RuntimeError("Invalid box created")
|
||||||
else:
|
else:
|
||||||
print "\nBox is valid"
|
print("\nBox is valid")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
mindeg = 2
|
mindeg = 2
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
|
Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import salome
|
import salome
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
def MakeHelix(radius, height, rotation, direction):
|
def MakeHelix(radius, height, rotation, direction):
|
||||||
# - create a helix -
|
# - create a helix -
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# Create a box
|
# Create a box
|
||||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# Create Vertexes for curve
|
# Create Vertexes for curve
|
||||||
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create box
|
# create box
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||||
@ -13,10 +13,10 @@ cylinder = geompy.MakeCylinderRH(100, 300)
|
|||||||
|
|
||||||
isOk, res1, res2 = geompy.FastIntersect(box, cylinder)
|
isOk, res1, res2 = geompy.FastIntersect(box, cylinder)
|
||||||
if isOk == 0:
|
if isOk == 0:
|
||||||
raise RuntimeError, "No intersection!"
|
raise RuntimeError("No intersection!")
|
||||||
else:
|
else:
|
||||||
print "\nTwo lists of indexes of sub-shapes localize the intersection:"
|
print("\nTwo lists of indexes of sub-shapes localize the intersection:")
|
||||||
print res1, res2
|
print(res1, res2)
|
||||||
|
|
||||||
# create two boxes with gap
|
# create two boxes with gap
|
||||||
Ver1 = geompy.MakeVertex(0, 0, 0)
|
Ver1 = geompy.MakeVertex(0, 0, 0)
|
||||||
@ -28,7 +28,7 @@ box2 = geompy.MakeBoxTwoPnt(Ver3, Ver4)
|
|||||||
|
|
||||||
isOk1, aRes1, aRes2 = geompy.FastIntersect(box1, box2, 1.)
|
isOk1, aRes1, aRes2 = geompy.FastIntersect(box1, box2, 1.)
|
||||||
if isOk1 == 0:
|
if isOk1 == 0:
|
||||||
raise RuntimeError, "No gaps!"
|
raise RuntimeError("No gaps!")
|
||||||
else:
|
else:
|
||||||
print "\nTwo lists of indexes of sub-shapes localize the gap:"
|
print("\nTwo lists of indexes of sub-shapes localize the gap:")
|
||||||
print aRes1, aRes2
|
print(aRes1, aRes2)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a shape
|
# create a shape
|
||||||
box1 = geompy.MakeBox(0, 0, 0, 100, 100, 100)
|
box1 = geompy.MakeBox(0, 0, 0, 100, 100, 100)
|
||||||
@ -19,17 +19,17 @@ for fi in range(len(faces)):
|
|||||||
fid = geompy.addToStudyInFather(cut, faces[fi], "Face %d" % (fi+1))
|
fid = geompy.addToStudyInFather(cut, faces[fi], "Face %d" % (fi+1))
|
||||||
isSuccess, closedWires, openWires = geompy.GetFreeBoundary(faces[fi])
|
isSuccess, closedWires, openWires = geompy.GetFreeBoundary(faces[fi])
|
||||||
if isSuccess:
|
if isSuccess:
|
||||||
print "Check free boundaries in face %d: OK" % (fi+1)
|
print("Check free boundaries in face %d: OK" % (fi+1))
|
||||||
print "-- Nb of closed boundaries = %d" % len(closedWires)
|
print("-- Nb of closed boundaries = %d" % len(closedWires))
|
||||||
for wi in range(len(closedWires)):
|
for wi in range(len(closedWires)):
|
||||||
wid = geompy.addToStudyInFather(faces[fi], closedWires[wi], "Closed wire %d" % (wi+1))
|
wid = geompy.addToStudyInFather(faces[fi], closedWires[wi], "Closed wire %d" % (wi+1))
|
||||||
pass
|
pass
|
||||||
print "-- Nb of open boundaries = %d" % len(openWires)
|
print("-- Nb of open boundaries = %d" % len(openWires))
|
||||||
for wi in range(len(openWires)):
|
for wi in range(len(openWires)):
|
||||||
wid = geompy.addToStudyInFather(faces[fi], openWires[wi], "Open wire %d" % (wi+1))
|
wid = geompy.addToStudyInFather(faces[fi], openWires[wi], "Open wire %d" % (wi+1))
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print "Check free boundaries in face %d: KO" % (fi+1)
|
print("Check free boundaries in face %d: KO" % (fi+1))
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
@ -31,7 +31,7 @@ cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
|
|||||||
|
|
||||||
# suppress the specified wire
|
# suppress the specified wire
|
||||||
result = geompy.GetFreeFacesIDs(cut_without_f_2)
|
result = geompy.GetFreeFacesIDs(cut_without_f_2)
|
||||||
print "A number of free faces is ", len(result)
|
print("A number of free faces is ", len(result))
|
||||||
|
|
||||||
# add objects in the study
|
# add objects in the study
|
||||||
all_faces = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["FACE"])
|
all_faces = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["FACE"])
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create solids
|
# create solids
|
||||||
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
|
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
import tempfile, os
|
import tempfile, os
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
In = geompy.Inertia(box)
|
In = geompy.Inertia(box)
|
||||||
print "\nInertia matrix of box 100x30x100:"
|
print("\nInertia matrix of box 100x30x100:")
|
||||||
print " (", In[0], ", ", In[1], ", ", In[2], ")"
|
print(" (", In[0], ", ", In[1], ", ", In[2], ")")
|
||||||
print " (", In[3], ", ", In[4], ", ", In[5], ")"
|
print(" (", In[3], ", ", In[4], ", ", In[5], ")")
|
||||||
print " (", In[6], ", ", In[7], ", ", In[8], ")"
|
print(" (", In[6], ", ", In[7], ", ", In[8], ")")
|
||||||
print "Main moments of inertia of box 100x30x100:"
|
print("Main moments of inertia of box 100x30x100:")
|
||||||
print " Ix = ", In[9], ", Iy = ", In[10], ", Iz = ", In[11]
|
print(" Ix = ", In[9], ", Iy = ", In[10], ", Iz = ", In[11])
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# Create two curves with three closest points
|
# Create two curves with three closest points
|
||||||
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
||||||
@ -46,8 +46,8 @@ for i in range(nbSols):
|
|||||||
geompy.addToStudy(v2, 'MinDist_%d_Curve_b'%(i+1))
|
geompy.addToStudy(v2, 'MinDist_%d_Curve_b'%(i+1))
|
||||||
|
|
||||||
# Get minimum distance
|
# Get minimum distance
|
||||||
print "Minimal distance between Curve_a and Curve_b is", geompy.MinDistance(Curve_a, Curve_b)
|
print("Minimal distance between Curve_a and Curve_b is", geompy.MinDistance(Curve_a, Curve_b))
|
||||||
|
|
||||||
# Get minimum distance with components along axes
|
# Get minimum distance with components along axes
|
||||||
[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Curve_a, Curve_b)
|
[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Curve_a, Curve_b)
|
||||||
print "Minimal distance between Curve_a and Curve_b is (", DX, ",", DY, ",", DZ, ")"
|
print("Minimal distance between Curve_a and Curve_b is (", DX, ",", DY, ",", DZ, ")")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
@ -14,8 +14,8 @@ faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
|
|||||||
face0 = faces[0]
|
face0 = faces[0]
|
||||||
vnorm = geompy.GetNormal(face0)
|
vnorm = geompy.GetNormal(face0)
|
||||||
if vnorm is None:
|
if vnorm is None:
|
||||||
raise RuntimeError, "GetNormal(face0) failed"
|
raise RuntimeError("GetNormal(face0) failed")
|
||||||
else:
|
else:
|
||||||
geompy.addToStudy(face0, "Face0")
|
geompy.addToStudy(face0, "Face0")
|
||||||
geompy.addToStudy(vnorm, "Normale to Face0")
|
geompy.addToStudy(vnorm, "Normale to Face0")
|
||||||
print "\nNormale of face has been successfully obtained"
|
print("\nNormale of face has been successfully obtained")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import salome_notebook
|
import salome_notebook
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a point
|
# create a point
|
||||||
point = geompy.MakeVertex(15., 23., 80.)
|
point = geompy.MakeVertex(15., 23., 80.)
|
||||||
@ -18,8 +18,8 @@ tolerance = 1.e-07
|
|||||||
def IsEqual(val1, val2): return (math.fabs(val1 - val2) < tolerance)
|
def IsEqual(val1, val2): return (math.fabs(val1 - val2) < tolerance)
|
||||||
|
|
||||||
if IsEqual(coords[0], 15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):
|
if IsEqual(coords[0], 15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):
|
||||||
print "All values are OK."
|
print("All values are OK.")
|
||||||
else :
|
else :
|
||||||
print "Coordinates of point must be (15, 23, 80), but returned (",
|
print("Coordinates of point must be (15, 23, 80), but returned (", end=' ')
|
||||||
print coords[0], ", ", coords[1], ", ", coords[2], ")"
|
print(coords[0], ", ", coords[1], ", ", coords[2], ")")
|
||||||
pass
|
pass
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -6,7 +6,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex
|
# create a vertex
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices, an edge, an arc, a wire, a face and a prism
|
# create vertices, an edge, an arc, a wire, a face and a prism
|
||||||
@ -18,12 +18,12 @@ face = geompy.MakeFace(wire, 1)
|
|||||||
theShape = geompy.MakePrismVecH(face, edge, 130)
|
theShape = geompy.MakePrismVecH(face, edge, 130)
|
||||||
|
|
||||||
# check the shape at the beginning
|
# check the shape at the beginning
|
||||||
print "Before ProcessShape:"
|
print("Before ProcessShape:")
|
||||||
isValid = geompy.CheckShape(theShape)
|
isValid = geompy.CheckShape(theShape)
|
||||||
if isValid == 0:
|
if isValid == 0:
|
||||||
print "The shape is not valid"
|
print("The shape is not valid")
|
||||||
else:
|
else:
|
||||||
print "The shape seems to be valid"
|
print("The shape seems to be valid")
|
||||||
|
|
||||||
# process the Shape
|
# process the Shape
|
||||||
Operators = ["FixShape"]
|
Operators = ["FixShape"]
|
||||||
@ -32,13 +32,13 @@ Values = ["1e-7"]
|
|||||||
PS = geompy.ProcessShape(theShape, Operators, Parameters, Values)
|
PS = geompy.ProcessShape(theShape, Operators, Parameters, Values)
|
||||||
|
|
||||||
# check the shape at the end
|
# check the shape at the end
|
||||||
print "After ProcessShape:"
|
print("After ProcessShape:")
|
||||||
isValid = geompy.CheckShape(PS)
|
isValid = geompy.CheckShape(PS)
|
||||||
if isValid == 0:
|
if isValid == 0:
|
||||||
print "The shape is not valid"
|
print("The shape is not valid")
|
||||||
raise RuntimeError, "It seems, that the ProcessShape() has failed"
|
raise RuntimeError("It seems, that the ProcessShape() has failed")
|
||||||
else:
|
else:
|
||||||
print "The shape seems to be valid"
|
print("The shape seems to be valid")
|
||||||
|
|
||||||
# add in the study and display
|
# add in the study and display
|
||||||
Id_Shape = geompy.addToStudy(theShape, "Invalid Shape")
|
Id_Shape = geompy.addToStudy(theShape, "Invalid Shape")
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices and vectors
|
# create vertices and vectors
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome, math
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
|
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create base points
|
# create base points
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create boxes
|
# create boxes
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create boxes
|
# create boxes
|
||||||
@ -30,4 +30,4 @@ geompy.addToStudy(glue1, "Glue all edges")
|
|||||||
geompy.addToStudy(glue2, "Glue two edges")
|
geompy.addToStudy(glue2, "Glue two edges")
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# import initial topology with bad tolerances (more than 1e-07)
|
# import initial topology with bad tolerances (more than 1e-07)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# Variant 1: using DivideEdge()
|
# Variant 1: using DivideEdge()
|
||||||
|
|
||||||
@ -40,4 +40,4 @@ edge = geompy.GetEdgeNearPoint( box, p1, theName="edge to split")
|
|||||||
div = geompy.DivideEdgeByPoint( box, edge, [p1, p2], theName="box (edge divided)")
|
div = geompy.DivideEdgeByPoint( box, edge, [p1, p2], theName="box (edge divided)")
|
||||||
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
p1 = geompy.MakeVertex(0, 0, 0)
|
p1 = geompy.MakeVertex(0, 0, 0)
|
||||||
@ -49,4 +49,4 @@ for wire in wires:
|
|||||||
ii = ii + 1
|
ii = ii + 1
|
||||||
pass
|
pass
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create solids with some coincident faces
|
# create solids with some coincident faces
|
||||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
@ -23,4 +23,4 @@ geompy.addToStudy(Partition_1, 'Partition_1')
|
|||||||
Joined_1 = geompy.RemoveInternalFaces(Partition_1)
|
Joined_1 = geompy.RemoveInternalFaces(Partition_1)
|
||||||
geompy.addToStudy(Joined_1, 'Joined_1')
|
geompy.addToStudy(Joined_1, 'Joined_1')
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@ -17,7 +18,6 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import unittest, sys, os
|
import unittest, sys, os
|
||||||
|
|
||||||
|
@ -4,15 +4,15 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||||
Toler = geompy.Tolerance(box)
|
Toler = geompy.Tolerance(box)
|
||||||
print "\nBox 100x30x100 tolerance:"
|
print("\nBox 100x30x100 tolerance:")
|
||||||
print " Face min. tolerance: ", Toler[0]
|
print(" Face min. tolerance: ", Toler[0])
|
||||||
print " Face max. tolerance: ", Toler[1]
|
print(" Face max. tolerance: ", Toler[1])
|
||||||
print " Edge min. tolerance: ", Toler[2]
|
print(" Edge min. tolerance: ", Toler[2])
|
||||||
print " Edge max. tolerance: ", Toler[3]
|
print(" Edge max. tolerance: ", Toler[3])
|
||||||
print " Vertex min. tolerance: ", Toler[4]
|
print(" Vertex min. tolerance: ", Toler[4])
|
||||||
print " Vertex max. tolerance: ", Toler[5]
|
print(" Vertex max. tolerance: ", Toler[5])
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices
|
# create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
#create vertices
|
#create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
#create vertices
|
#create vertices
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a vertex and a vector
|
# create a vertex and a vector
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
import math
|
import math
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box
|
# create a box
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box and a sphere
|
# create a box and a sphere
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create a box and a sphere
|
# create a box and a sphere
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
# create a cylindric face and a curve(edge)
|
# create a cylindric face and a curve(edge)
|
||||||
cylinder = geompy.MakeCylinderRH(100, 300)
|
cylinder = geompy.MakeCylinderRH(100, 300)
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create vertices and vectors
|
# create vertices and vectors
|
||||||
|
@ -4,7 +4,7 @@ import salome
|
|||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
import GEOM
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New()
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user