mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Merge V9_dev branch into master
This commit is contained in:
commit
4df93cfed7
@ -1,5 +1,4 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-1 -*-
|
||||
#! /usr/bin/env python3
|
||||
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
@ -58,7 +57,7 @@ def set_env( args ):
|
||||
plugin_list.append("AdvancedGEOM")
|
||||
|
||||
# find additional plugins
|
||||
for env_var in os.environ.keys():
|
||||
for env_var in os.environ:
|
||||
value = os.environ[env_var]
|
||||
if env_var[-9:] == "_ROOT_DIR" and value:
|
||||
plugin_root = value
|
||||
@ -84,7 +83,7 @@ def set_env( args ):
|
||||
plugin_list.append(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())
|
||||
os.environ["SALOME_"+plugin+"Resources"] = resource_path
|
||||
resource_path_list.append(resource_path)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# Create a 3D sketcher (wire) on the given points coordinates
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# a box
|
||||
|
@ -5,7 +5,7 @@ salome.salome_init()
|
||||
# --- geom Python interface
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# --- Create a box and publish it into the salome study
|
||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||
@ -13,4 +13,4 @@ geompy.addToStudy( Box_1, 'Box_1' )
|
||||
|
||||
# --- update the study object browser
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create PipeTShape object
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create DividedDisk object
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create DividedCylinder object
|
||||
|
@ -1,6 +1,6 @@
|
||||
import salome, GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a could of points
|
||||
points = [
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
|
||||
OX = geompy.MakeVectorDXDYDZ(10, 0,0)
|
||||
@ -13,39 +13,39 @@ OXY = geompy.MakeVectorDXDYDZ(10,10,0)
|
||||
# in one plane
|
||||
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:
|
||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
||||
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||
pass
|
||||
|
||||
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:
|
||||
print " Error: returned angle is", Angle, "while must be pi/4"
|
||||
print(" Error: returned angle is", Angle, "while must be pi/4")
|
||||
pass
|
||||
|
||||
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:
|
||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
||||
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||
pass
|
||||
|
||||
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:
|
||||
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
|
||||
|
||||
# not in one plane
|
||||
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
|
||||
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:
|
||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
||||
print(" Error: returned angle is", Angle, "while must be 45.0")
|
||||
pass
|
||||
|
||||
# not linear
|
||||
|
@ -5,7 +5,7 @@ salome.salome_init()
|
||||
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
Circle_1 = geompy.MakeCircle(None, None, 100)
|
||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||
@ -22,4 +22,4 @@ geompy.PutListToFolder([Box_1, Cylinder_1], Primitives)
|
||||
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices and vectors
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
import SALOMEDS
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
import SALOMEDS
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import SALOMEDS
|
||||
|
||||
# create a box and a cylinder
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import SALOMEDS
|
||||
|
||||
# create a box and partigion it by two planes
|
||||
|
@ -4,21 +4,21 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
props = geompy.BasicProperties(box)
|
||||
print "\nBox 100x30x100 Basic Properties:"
|
||||
print " Wires length: ", props[0]
|
||||
print " Surface area: ", props[1]
|
||||
print " Volume : ", props[2]
|
||||
print("\nBox 100x30x100 Basic Properties:")
|
||||
print(" Wires length: ", props[0])
|
||||
print(" Surface area: ", props[1])
|
||||
print(" Volume : ", props[2])
|
||||
length = math.sqrt((props[0] - 1840)*(props[0] - 1840))
|
||||
area = math.sqrt((props[1] - 32000)*(props[1] - 32000))
|
||||
volume = math.sqrt((props[2] - 300000)*(props[2] - 300000))
|
||||
if length > 1e-7 or area > 1e-7 or volume > 1e-7:
|
||||
print "While must be:"
|
||||
print " Wires length: ", 1840
|
||||
print " Surface area: ", 32000
|
||||
print " Volume : ", 300000.
|
||||
print("While must be:")
|
||||
print(" Wires length: ", 1840)
|
||||
print(" Surface area: ", 32000)
|
||||
print(" Volume : ", 300000.)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box and a sphere
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||
@ -16,8 +16,8 @@ listChains = geompy.Propagate(check_box)
|
||||
geompy.addToStudy(check_box, "Box")
|
||||
ii = 1
|
||||
for chain in listChains:
|
||||
geompy.addToStudyInFather(check_box, chain, "propagation chain " + `ii`)
|
||||
geompy.addToStudyInFather(check_box, chain, "propagation chain " + repr(ii))
|
||||
ii = ii + 1
|
||||
pass
|
||||
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,16 +4,16 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
|
||||
bb = geompy.BoundingBox(box)
|
||||
print "\nBounding Box of box 100x30x100:"
|
||||
print " Xmin = ", bb[0], ", Xmax = ", bb[1]
|
||||
print " Ymin = ", bb[2], ", Ymax = ", bb[3]
|
||||
print " Zmin = ", bb[4], ", Zmax = ", bb[5]
|
||||
print("\nBounding Box of box 100x30x100:")
|
||||
print(" Xmin = ", bb[0], ", Xmax = ", bb[1])
|
||||
print(" Ymin = ", bb[2], ", Ymax = ", bb[3])
|
||||
print(" Zmin = ", bb[4], ", Zmax = ", bb[5])
|
||||
|
||||
aBB = geompy.MakeBoundingBox(box)
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,20 +4,20 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
cm = geompy.MakeCDG(box)
|
||||
if cm is None:
|
||||
raise RuntimeError, "MakeCDG(box) failed"
|
||||
raise RuntimeError("MakeCDG(box) failed")
|
||||
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)
|
||||
print "(", coords[0], ", ", coords[1], ", ", coords[2], ")"
|
||||
print("(", coords[0], ", ", coords[1], ", ", coords[2], ")")
|
||||
dx = math.sqrt((coords[0] - 50)*(coords[0] - 50))
|
||||
dy = math.sqrt((coords[1] - 15)*(coords[1] - 15))
|
||||
dz = math.sqrt((coords[2] - 50)*(coords[2] - 50))
|
||||
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()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create boxes
|
||||
@ -19,6 +19,6 @@ tolerance = 1e-5
|
||||
glue = geompy.MakeGlueFaces(compound, tolerance)
|
||||
IsValid = geompy.CheckCompoundOfBlocks(glue)
|
||||
if IsValid == 0:
|
||||
raise RuntimeError, "Invalid compound created"
|
||||
raise RuntimeError("Invalid compound created")
|
||||
else:
|
||||
print "\nCompound is valid"
|
||||
print("\nCompound is valid")
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||
@ -16,6 +16,6 @@ compound = geompy.MakeCompound([box, cylinder])
|
||||
# check self-intersection
|
||||
IsValid = geompy.CheckSelfIntersections(compound)
|
||||
if not IsValid:
|
||||
print "Shape is self-intersected!"
|
||||
print("Shape is self-intersected!")
|
||||
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()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||
@ -16,6 +16,6 @@ compound = geompy.MakeCompound([box, cylinder])
|
||||
# check self-intersection
|
||||
IsValid = geompy.CheckSelfIntersectionsFast(compound)
|
||||
if not IsValid:
|
||||
print "Shape is self-intersected!"
|
||||
print("Shape is self-intersected!")
|
||||
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()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
(IsValid, err) = geompy.CheckShape(box, 0, 2)
|
||||
if IsValid == 0:
|
||||
geompy.PrintShapeErrors(box, err)
|
||||
raise RuntimeError, "Invalid box created"
|
||||
raise RuntimeError("Invalid box created")
|
||||
else:
|
||||
print "\nBox is valid"
|
||||
print("\nBox is valid")
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
mindeg = 2
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
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])
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import salome
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -3,7 +3,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
def MakeHelix(radius, height, rotation, direction):
|
||||
# - create a helix -
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# Create a box
|
||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# Create Vertexes for curve
|
||||
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create box
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||
@ -13,10 +13,10 @@ cylinder = geompy.MakeCylinderRH(100, 300)
|
||||
|
||||
isOk, res1, res2 = geompy.FastIntersect(box, cylinder)
|
||||
if isOk == 0:
|
||||
raise RuntimeError, "No intersection!"
|
||||
raise RuntimeError("No intersection!")
|
||||
else:
|
||||
print "\nTwo lists of indexes of sub-shapes localize the intersection:"
|
||||
print res1, res2
|
||||
print("\nTwo lists of indexes of sub-shapes localize the intersection:")
|
||||
print(res1, res2)
|
||||
|
||||
# create two boxes with gap
|
||||
Ver1 = geompy.MakeVertex(0, 0, 0)
|
||||
@ -28,7 +28,7 @@ box2 = geompy.MakeBoxTwoPnt(Ver3, Ver4)
|
||||
|
||||
isOk1, aRes1, aRes2 = geompy.FastIntersect(box1, box2, 1.)
|
||||
if isOk1 == 0:
|
||||
raise RuntimeError, "No gaps!"
|
||||
raise RuntimeError("No gaps!")
|
||||
else:
|
||||
print "\nTwo lists of indexes of sub-shapes localize the gap:"
|
||||
print aRes1, aRes2
|
||||
print("\nTwo lists of indexes of sub-shapes localize the gap:")
|
||||
print(aRes1, aRes2)
|
||||
|
@ -3,7 +3,7 @@
|
||||
import salome
|
||||
salome.salome_init()
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a shape
|
||||
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))
|
||||
isSuccess, closedWires, openWires = geompy.GetFreeBoundary(faces[fi])
|
||||
if isSuccess:
|
||||
print "Check free boundaries in face %d: OK" % (fi+1)
|
||||
print "-- Nb of closed boundaries = %d" % len(closedWires)
|
||||
print("Check free boundaries in face %d: OK" % (fi+1))
|
||||
print("-- Nb of closed boundaries = %d" % len(closedWires))
|
||||
for wi in range(len(closedWires)):
|
||||
wid = geompy.addToStudyInFather(faces[fi], closedWires[wi], "Closed wire %d" % (wi+1))
|
||||
pass
|
||||
print "-- Nb of open boundaries = %d" % len(openWires)
|
||||
print("-- Nb of open boundaries = %d" % len(openWires))
|
||||
for wi in range(len(openWires)):
|
||||
wid = geompy.addToStudyInFather(faces[fi], openWires[wi], "Open wire %d" % (wi+1))
|
||||
pass
|
||||
pass
|
||||
else:
|
||||
print "Check free boundaries in face %d: KO" % (fi+1)
|
||||
print("Check free boundaries in face %d: KO" % (fi+1))
|
||||
pass
|
||||
pass
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
@ -31,7 +31,7 @@ cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
|
||||
|
||||
# suppress the specified wire
|
||||
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
|
||||
all_faces = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["FACE"])
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create solids
|
||||
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
import tempfile, os
|
||||
|
||||
|
@ -4,14 +4,14 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
In = geompy.Inertia(box)
|
||||
print "\nInertia matrix of box 100x30x100:"
|
||||
print " (", In[0], ", ", In[1], ", ", In[2], ")"
|
||||
print " (", In[3], ", ", In[4], ", ", In[5], ")"
|
||||
print " (", In[6], ", ", In[7], ", ", In[8], ")"
|
||||
print "Main moments of inertia of box 100x30x100:"
|
||||
print " Ix = ", In[9], ", Iy = ", In[10], ", Iz = ", In[11]
|
||||
print("\nInertia matrix of box 100x30x100:")
|
||||
print(" (", In[0], ", ", In[1], ", ", In[2], ")")
|
||||
print(" (", In[3], ", ", In[4], ", ", In[5], ")")
|
||||
print(" (", In[6], ", ", In[7], ", ", In[8], ")")
|
||||
print("Main moments of inertia of box 100x30x100:")
|
||||
print(" Ix = ", In[9], ", Iy = ", In[10], ", Iz = ", In[11])
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# Create two curves with three closest points
|
||||
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))
|
||||
|
||||
# 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
|
||||
[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()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
|
||||
# create a box
|
||||
@ -14,8 +14,8 @@ faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
|
||||
face0 = faces[0]
|
||||
vnorm = geompy.GetNormal(face0)
|
||||
if vnorm is None:
|
||||
raise RuntimeError, "GetNormal(face0) failed"
|
||||
raise RuntimeError("GetNormal(face0) failed")
|
||||
else:
|
||||
geompy.addToStudy(face0, "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()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import salome_notebook
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -5,7 +5,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a point
|
||||
point = geompy.MakeVertex(15., 23., 80.)
|
||||
@ -18,8 +18,8 @@ tolerance = 1.e-07
|
||||
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.):
|
||||
print "All values are OK."
|
||||
print("All values are OK.")
|
||||
else :
|
||||
print "Coordinates of point must be (15, 23, 80), but returned (",
|
||||
print coords[0], ", ", coords[1], ", ", coords[2], ")"
|
||||
print("Coordinates of point must be (15, 23, 80), but returned (", end=' ')
|
||||
print(coords[0], ", ", coords[1], ", ", coords[2], ")")
|
||||
pass
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -6,7 +6,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# 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)
|
||||
|
||||
# check the shape at the beginning
|
||||
print "Before ProcessShape:"
|
||||
print("Before ProcessShape:")
|
||||
isValid = geompy.CheckShape(theShape)
|
||||
if isValid == 0:
|
||||
print "The shape is not valid"
|
||||
print("The shape is not valid")
|
||||
else:
|
||||
print "The shape seems to be valid"
|
||||
print("The shape seems to be valid")
|
||||
|
||||
# process the Shape
|
||||
Operators = ["FixShape"]
|
||||
@ -32,13 +32,13 @@ Values = ["1e-7"]
|
||||
PS = geompy.ProcessShape(theShape, Operators, Parameters, Values)
|
||||
|
||||
# check the shape at the end
|
||||
print "After ProcessShape:"
|
||||
print("After ProcessShape:")
|
||||
isValid = geompy.CheckShape(PS)
|
||||
if isValid == 0:
|
||||
print "The shape is not valid"
|
||||
raise RuntimeError, "It seems, that the ProcessShape() has failed"
|
||||
print("The shape is not valid")
|
||||
raise RuntimeError("It seems, that the ProcessShape() has failed")
|
||||
else:
|
||||
print "The shape seems to be valid"
|
||||
print("The shape seems to be valid")
|
||||
|
||||
# add in the study and display
|
||||
Id_Shape = geompy.addToStudy(theShape, "Invalid Shape")
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices and vectors
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome, math
|
||||
salome.salome_init()
|
||||
from salome.geom import geomBuilder
|
||||
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create base points
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create boxes
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create boxes
|
||||
@ -30,4 +30,4 @@ geompy.addToStudy(glue1, "Glue all edges")
|
||||
geompy.addToStudy(glue2, "Glue two edges")
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# import initial topology with bad tolerances (more than 1e-07)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# 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)")
|
||||
|
||||
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create vertices
|
||||
p1 = geompy.MakeVertex(0, 0, 0)
|
||||
@ -49,4 +49,4 @@ for wire in wires:
|
||||
ii = ii + 1
|
||||
pass
|
||||
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create solids with some coincident faces
|
||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||
@ -23,4 +23,4 @@ geompy.addToStudy(Partition_1, 'Partition_1')
|
||||
Joined_1 = geompy.RemoveInternalFaces(Partition_1)
|
||||
geompy.addToStudy(Joined_1, 'Joined_1')
|
||||
|
||||
salome.sg.updateObjBrowser(True)
|
||||
salome.sg.updateObjBrowser()
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
import unittest, sys, os
|
||||
|
||||
|
@ -4,15 +4,15 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a box
|
||||
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
||||
Toler = geompy.Tolerance(box)
|
||||
print "\nBox 100x30x100 tolerance:"
|
||||
print " Face min. tolerance: ", Toler[0]
|
||||
print " Face max. tolerance: ", Toler[1]
|
||||
print " Edge min. tolerance: ", Toler[2]
|
||||
print " Edge max. tolerance: ", Toler[3]
|
||||
print " Vertex min. tolerance: ", Toler[4]
|
||||
print " Vertex max. tolerance: ", Toler[5]
|
||||
print("\nBox 100x30x100 tolerance:")
|
||||
print(" Face min. tolerance: ", Toler[0])
|
||||
print(" Face max. tolerance: ", Toler[1])
|
||||
print(" Edge min. tolerance: ", Toler[2])
|
||||
print(" Edge max. tolerance: ", Toler[3])
|
||||
print(" Vertex min. tolerance: ", Toler[4])
|
||||
print(" Vertex max. tolerance: ", Toler[5])
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
#
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
#create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
#create vertices
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a vertex and a vector
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
import math
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box and a sphere
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create a box and a sphere
|
||||
|
@ -3,7 +3,7 @@
|
||||
import salome
|
||||
salome.salome_init()
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
# create a cylindric face and a curve(edge)
|
||||
cylinder = geompy.MakeCylinderRH(100, 300)
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
|
||||
# create vertices and vectors
|
||||
|
@ -4,7 +4,7 @@ import salome
|
||||
salome.salome_init()
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
geompy = geomBuilder.New()
|
||||
gg = salome.ImportComponentGUI("GEOM")
|
||||
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