Compare commits

...

238 Commits

Author SHA1 Message Date
DUC ANH HOANG
f897399166 Revert "Revert "[EDF31321]: Add bootsrap in dependence""
This reverts commit 3628387a8bbfa28c6f89e3eb4a679d68467f0b9b.
2025-01-06 14:05:27 +01:00
mbs
3dada3ac1c [GITHUB][GEOM ISSUE#7] wrong doc for make ellipse 2025-01-03 12:25:02 +00:00
DUC ANH HOANG
3628387a8b Revert "[EDF31321]: Add bootsrap in dependence"
This reverts commit 419b248e234499994594e0a2b109eecca3b0d1e1.
2024-12-20 10:34:19 +01:00
DUC ANH HOANG
d77455bec0 Merge branch 'duc/odys_suit_integration' 2024-12-19 14:41:07 +01:00
mbs
386c243bd1 fixed crash in constructAISObject
The Prs3d_PointAspect pointer may be NULL.
2024-12-18 11:55:56 +00:00
DUC ANH HOANG
419b248e23 [EDF31321]: Add bootsrap in dependence 2024-12-16 12:00:57 +01:00
mbs
0c82f25ea9 updated URL in README 2024-12-13 11:09:50 +00:00
Konstantin Leontev
42b1e5a1ea [bos #43815][EDF 31529] Dependency of libGEOMEngine. Removed Qt dependencies. 2024-12-09 14:21:20 +00:00
mbs
1e56cfc237 [bos #43130] [EDF] (2024) Geometry Analysis Tool 2024-12-02 18:39:57 +00:00
dish
4698ac46c4 Add action ID mutations. 2024-11-28 12:38:29 +00:00
Konstantin Leontev
512bf4c67a [bos #43299][FORUM] Now after SetAutoColor(1) we can get automatically generated color back by GetColor() call. Previous implementation didn't set a color to an object, but calculated it only for a viewer. 2024-11-08 10:39:12 +00:00
jfa
67feb126ff [bos #40618] [CEA] Offset/Thickness Feature. 2024-11-08 10:37:36 +01:00
dish
0d99124b62 [bos #42003][EDF] (2024) Shortcuts improvements 2024-11-07 09:09:39 +01:00
dish
086dfca578 dish/CR42003--Shortcuts_improvements
Make action_assets.json compliant with current version of SUIT_ShortcutMgr. Place actions in folders and add icon paths.
2024-11-07 09:09:39 +01:00
Konstantin Leontev
ad427fadef [bos #43278][EDF 25230] MakeVertexInsideFace too long. Added ShapeFix for result created by ShapeUpgrade_ShapeDivideArea. 2024-11-04 15:32:44 +00:00
Konstantin Leontev
c4da8107c8 [bos #43299][FORUM] geom.GetColor() does not give the good result. Fixed set color for geom object. 2024-10-30 15:58:58 +00:00
jfa
55b640ee17 [bos #32155] EDF 25230 - face non planar 2024-10-02 10:45:15 +01:00
jfa
78d008f3a2 [bos #42424] [CEA][FORUM] bug with MinDistance in Geom Module. Old workarounds causing the problem have been abandoned. 2024-09-13 13:02:41 +01:00
mbs
d72c6cd028 [GITHUB #1] updated TUI command doc for make sphere from point and radius 2024-09-09 10:16:27 +01:00
jfa
ae49976071 Merge branch 'V9_13_BR' 2024-09-04 16:54:05 +01:00
jfa
1bcfb1186e Increment version: 9.13.0 2024-06-27 19:37:19 +01:00
jfa
fbbd6a9e07 Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM GEOM_IOperations.hxx) 2024-05-27 20:11:28 +01:00
jfa
5e34fe0812 Implement bos #35141 Makewire keeping types of edges 2024-05-27 13:07:29 +01:00
dish
ec3ebbe891 [bos #41409][FORUM] (2024) kindOfShape() bug for CONE2D
Make KindOfShape() work correctly in cases, when substrate surface is cone and contour-wire is arbitrary (tested with a wire, composed of lines and 2-order curves).
2024-05-24 13:04:45 +01:00
Ekaterina Sukhareva
5f12362860 [EDF] (2023-T3) Creation of a non planar face from a list of edges and points 2024-05-22 18:38:19 +01:00
mbs
0f3f338dc8 Merge branch 'OCCT780' 2024-05-16 08:32:44 +01:00
jfa
981c0534ea Porting to OCCT 7.8.0 2024-05-16 08:30:45 +01:00
dish
bbafce4b04 [bos #35160][EDF](2023-T1) Keyboard shortcuts.
The branch must be synchronized with GUI:/dish/CR35160--Keyboard_Shortcuts.
Most of GEOM module actions are available for shortcut binding using UI.
2024-05-15 17:35:18 +01:00
Nabil Ghodbane
20db2ca25d [bos #41189]: ensure compatibility with Python 3.9+ 2024-04-24 14:55:58 +02:00
Nabil Ghodbane
c13ae14b5a bos #41647 [CEA][Windows] bos #38044 breaks GEOM compilation 2024-04-08 09:27:15 +02:00
NATHALIE GORE
14e1a694c4 Merge C++ part of kleontev/38044_auto_repair 2024-04-04 11:49:08 +02:00
mbs
e3ce834889 [bos #40619][CEA] Add Fuzzy parameter to partition and boolean operators 2024-03-19 10:28:27 +00:00
NATHALIE GORE
3bfb88115e Revert "EDF 25230 - Impossible to create directly a face"
This reverts commit aecc16bb8400d9673445a0485fc625ed28f71b9c.
2024-02-12 15:13:33 +01:00
Ekaterina Sukhareva
aecc16bb84 EDF 25230 - Impossible to create directly a face 2024-02-06 11:01:51 +00:00
mbs
e067674b75 Updated copyright comment 2024-01-20 13:51:38 +00:00
jfa
c52059c3f8 [bos #39942] EDF 25230 - New problem with XYZtoUV 2024-01-17 14:34:37 +00:00
jfa
6395ebefdf Increment version: 9.12.0 2023-11-20 18:25:56 +00:00
Konstantin Leontev
f7a34e7081 [bos #37951][EDF 25230] SIGSEGV with MakeVertexInsideFace. Added check for an uninitialized curve. 2023-10-16 16:12:16 +01:00
Pascal Obry
a501322551 Merge branch 'po/29467_gui_log_file'
* po/29467_gui_log_file:
  Use logStructuredUserEvent() for log message format consistency.
  [bos #29467] [EDF] (2022-T1) Logging of SALOME usage: specific log in SALOME
2023-09-11 09:00:04 +02:00
Pascal Obry
efb533a09c Use logStructuredUserEvent() for log message format consistency.
Also clean-up the operation name to keep only the meaningful
part.
2023-09-05 11:37:53 +02:00
vsr
221a1f9cef [bos #29467] [EDF] (2022-T1) Logging of SALOME usage: specific log in SALOME 2023-09-05 11:37:53 +02:00
jfa
d2ccc47fec [bos #36247] EDF 25230 - conversion xyz => uv KO 2023-08-18 15:51:03 +01:00
jfa
071708e71c [bos #36177] [FORUM] - Remove extra-edge on hemisphere 2023-08-17 22:17:57 +01:00
jfa
d07da73210 [bos #36169] EDF 25230 - Conversion xyz => uv => xyz. Replace all calls of ShapeAnalysis::GetFaceUVBounds to BRepTools::UVBounds. 2023-08-14 14:46:57 +01:00
jfa
1e6d06f174 Implementation of [bos #35140] [EDF] (2023-T1) Memory communication between SHAPER and GEOM 2023-08-08 16:56:20 +01:00
jfa
d617faae6b Merge branch 'V9_11_BR' 2023-07-19 15:56:13 +01:00
jfa
e8fc8b6907 [bos #35094] [EDF] (2023-T1) X,Y,Z to U,V. Consider face tolerance. 2023-06-26 17:56:13 +01:00
mbs
09ece3edc1 updated copyright message 2023-06-19 17:32:54 +01:00
mbs
c1d63ef1f8 updated copyright message 2023-06-16 19:43:36 +01:00
Nabil Ghodbane
9473f01eac bos #35672: fix std::min issue on windows 2023-06-05 11:34:59 +02:00
DOROVSKIKH Julia OpenCascade
7725eb65c0 Merge commit '4823245056426a9ccf9c7965daecf11459f58af5' into V9_11_BR 2023-06-01 17:56:27 +02:00
mbs
132bafd2dc added missing descriptions and basic properties in WhatIs dialof for all newly supported edge types in KindOfShape() method 2023-05-31 19:41:55 +01:00
mbs
cfc267474f added support for all type of edges in KindOfShape method 2023-05-29 18:23:13 +01:00
jfa
9b8d462a3d Increment version: 9.11.0 2023-05-25 14:54:12 +01:00
mbs
4823245056 Avoid SIGSEGV in WhatIs and PrintShapeErrors methods when shape is NULL 2023-05-16 11:29:26 +01:00
jfa
611d40ba2a Implemented [bos #35094] [EDF] (2023-T1) X,Y,Z to U,V. 2023-05-12 09:46:46 +01:00
Anthony Geay
e06f87b076 First integration of a new PV3D viewer. 2023-04-17 09:35:25 +02:00
mbs
ddba456747 Fixed bos#34419 - class member was not initialized 2023-04-12 17:51:04 +01:00
jfa
5a3993c7b0 [bos #33687] EDF 26791 - Points cloud on face 2023-04-04 14:51:11 +01:00
jfa
c586fe244b Merge branch 'jfa/29468' 2023-03-16 16:14:04 +00:00
azv
9f73090059 bos #29468: Advanced geometry features: distance Edge-Edge & Face-Face 2023-03-16 15:50:52 +00:00
jfa
901ba4f298 Porting Salome to OCCT 7.7.0 2023-03-10 15:32:01 +00:00
jfa
1c82b096f9 Porting Salome to OCCT 7.7.0 2023-03-08 11:13:45 +00:00
jfa
fe14e2fc44 Porting Salome to OCCT 7.7.0 2023-03-07 17:18:15 +00:00
jfa
922cc08eea Porting Salome to OCCT 7.7.0 2023-02-17 16:55:49 +00:00
jfa
63e04ef7a7 [bos #33060] EDF 26527 - remove extra-edges doesn't work 2023-02-10 14:38:14 +00:00
jfa
78d08f2f51 [bos #33377] EDF 25230 - Question about tolerance. Prevent conversion of initial curves to BSplines by MakeWire. 2023-02-09 15:29:47 +00:00
jfa
5ff491732f Merge branch 'V9_10_BR' 2022-12-15 21:31:52 +03:00
jfa
656b91bf45 Avoid creation of tmp files in HOME 2022-12-06 19:00:18 +03:00
jfa
abd699810f [bos #32720] EDF 25230 - partition fails on small case 2022-11-22 15:08:47 +03:00
jfa
fe6ea9b095 Increment version: 9.10.0 2022-11-22 14:18:59 +03:00
jfa
7c90108313 [bos #32720] EDF 25230 - partition fails on small case 2022-11-18 18:19:11 +03:00
akondrat
db6a6a7fe5 [bos #32774] [CEA 32488] Selecting multiple faces with "Supress Faces"
Update selection in Suppress Faces algorithm.
2022-11-15 12:08:56 +03:00
jfa
888b3b52e1 [bos #32517][EDF] Dynamic log messages switched on and off by SALOME_VERBOSE environment variable 2022-11-14 17:48:46 +03:00
jfa
66be812a4e [bos #30178] [CEA][FORUM] Fuse operation fails on Linux and is OK on Windows 2022-10-27 16:31:43 +03:00
Konstantin LEONTEV
be1d76dd6a [bos #32189][CEA] SALOME README file: updated links to salome site. 2022-10-04 18:08:11 +03:00
jfa
75780cdf0f Merge branch 'jfa/29473' 2022-09-26 17:44:04 +03:00
Alexey SOZINOV
f190cc9ae6 [bos #29473] [EDF] (2022-T1) Advanced geometry features: conformity of non holed-face 2022-09-26 17:43:15 +03:00
jfa
89b8ea7bd7 Merge branch '29469' 2022-09-08 18:31:42 +03:00
vsv
bb74bfbe1e bos #29469: Advanced geometry features: Detect type of shape 2022-09-08 18:29:01 +03:00
Konstantin LEONTEV
46676347f2 Mantis 0054772: crash when select point in viewer inside created face 2022-08-31 16:00:11 +03:00
jfa
a3eca73f94 Merge branch 'asozinov/29471' 2022-08-30 16:36:03 +03:00
Alexey Sozinov
de644ac6fe [bos #29471] [EDF] (2022-T1) Advanced geometry features: iterate through holes of a face 2022-08-30 16:34:10 +03:00
jfa
e6d054cfcd Merge branch 'jgv/29470' 2022-08-18 17:47:07 +03:00
jgv
66a2554913 29470 - Point cloud on a face 2022-08-18 17:42:21 +03:00
jfa
ade417c569 Merge branch 'jfa/29472_curvature_vector' 2022-08-18 16:09:23 +03:00
jfa
335b028279 [bos #29472] [EDF] (2022-T1) Advanced geometry features: curvature vector on a point of a face 2022-08-18 15:51:43 +03:00
Anthony Geay
1b56fc0813 MakeFaceWires and MakeFace can raise RuntimeError in case of a non planar detected 2022-06-09 13:44:53 +02:00
vsr
c00b6875b6 Merge branch 'V9_9_BR' 2022-05-31 11:15:53 +03:00
vsr
b6f0965afb Copyright update 2022 2022-05-05 15:01:15 +03:00
vsr
cdb4ec65a7 Increment version: 9.9.0 2022-05-05 14:57:35 +03:00
vsr
4598d83cc4 bos #29484 Merge branch 'vsr/29484' 2022-04-21 12:40:53 +03:00
vsr
23463956b0 bos #29484 Add a test service to build tesselation on a shape 2022-04-21 12:40:44 +03:00
rnv
a847e2c649 Merge branch 'rnv/29456' 2022-04-19 11:59:16 +03:00
rnv
0dc7370a1a #29456 [EDF] (2022-T1) Finalization of SSL implementation 2022-04-19 11:58:37 +03:00
jfa
736d34a14f [bos #29336] problem in inertia calculus 2022-04-15 18:29:38 +03:00
jfa
a775d71f3f [bos #29336] problem in inertia calculus 2022-04-13 16:19:54 +03:00
eap
e3980c1c79 bos #29332 [CEA 26899] GroupOnGeom returns None
Make return an empty compound for an empty group
  where list == [-1]
2022-03-16 18:07:06 +03:00
vsr
ac075ee14b Fix misprint 2022-03-10 16:16:10 +03:00
jfa
8bd22224ca [bos #26723] EDF 24464 - Problem of extra-edges 2022-03-09 18:33:58 +03:00
jfa
c6dad39806 [bos #29103] EDF 24802 - limitation of tolerance 2022-03-05 10:34:20 +03:00
vsr
79d9367898 Correct test runner after switch default run mode to SSL 2022-02-18 18:31:08 +03:00
Anthony Geay
f504886648 Fix YacsLoaderTest::foreachs test 2022-02-18 13:15:20 +01:00
jfa
807a056cd8 [bos #28816] EDF 24678 - tolerance with wires 2022-02-04 21:25:03 +03:00
jfa
15ca7707dd [bos #28855] EDF 24963 - multi-explode. 2022-02-03 18:34:59 +03:00
Anthony Geay
58bfedf8f6 GEOMGUI uses standard LifeCycle to instanciate GEOM engine 2022-01-24 14:56:07 +01:00
Anthony Geay
8df37edc3d [tuleap26948] : fix of Dump study does not work after study reopening 2022-01-24 10:48:24 +01:00
rnv
d3582bad2b Remove unnecessary includes 2021-12-14 19:09:06 +03:00
vsr
81ba4eae5b Merge branch 'V9_8_BR' 2021-12-10 12:22:32 +03:00
jfa
93082a7c84 [bos #26726] EDF 24466 - CheckAndImprove generates wrong result. Fix SIGSEGV on CheckCompoundOfBlocks failure. 2021-12-07 11:39:02 +03:00
vsr
71b630d73e Increment version: 9.8.0 2021-11-26 13:38:12 +03:00
vsr
4bd9a6f6fe Fix test script: correct textures location 2021-11-11 17:35:16 +03:00
vsr
9fddcc1f36 Merge branch 'vsr/26458' 2021-10-04 20:46:46 +03:00
vsr
8a3c509833 bos #26458 Versioning of sources via git commit id (sha1) 2021-10-04 12:57:53 +03:00
jfa
6a0d013cc0 Bos #16182. Use OCCT algo UnifySameDomain. Fix for compatibility with old OCCT versions. 2021-09-08 12:03:03 +03:00
jfa
8db1e932e3 Usage of ShapeUpgrade_UnifySameDomain instead of BlockFix_UnionFaces and BlockFix_UnionEdges. 2021-09-06 15:03:21 +03:00
jgv
d6f16273ad Rewrite local function ModifySurface of BlockFix_SphereSpaceModifier 2021-09-06 11:28:04 +03:00
Anthony Geay
8d33dd3a86 Switch to SSL mode for tests : naive approach 2021-08-12 08:45:03 +02:00
Anthony Geay
8d26af3d7b Container servant hold information about SSL mode or not 2021-06-09 17:29:51 +02:00
jfa
f4e6b4a197 Bos #20438: [CEA] SIGSEGV in SHAPER and GEOM in Pipe binormal. Correction to obtain good result in GEOM. 2021-05-26 12:53:51 +03:00
vsr
2bfc3d1007 Merge branch 'V9_7_BR' 2021-05-24 17:20:56 +03:00
Gérald NICOLAS
8687a56839 Traduction pour les panneaux d'aide 2021-05-19 17:20:50 +03:00
rnv
f9cf20ad5b NOMINMAX definition has been moved into CONFIGURATION repository. 2021-04-30 00:12:39 +03:00
vsr
ef169a51e2 Increment version: 9.7.0 2021-04-27 16:20:32 +03:00
vsr
22d3109060 Avoid installing redundant files 2021-04-06 11:08:33 +03:00
vsr
25a3dc9150 Copyright update 2021 2021-03-22 19:09:10 +03:00
vsr
016f03aaff Backward compatibility with OpenCV 2x 2021-03-16 14:26:59 +03:00
vsr
5d251af706 Clean-up unused variables wrongly added by previous commit 2021-03-15 12:14:00 +03:00
YOANN AUDOUIN
656de216bc Old development made for salome Hydro:
To allow to move points on spline curve
curveCreator :: allow selection of points of selected polyline(s) only
2021-03-05 16:00:47 +01:00
vsr
4048b73d92 Remove deprecated OpenCV includes 2021-03-03 20:30:15 +03:00
rnv
7dbab99806 Compilation under Windows. 2021-03-03 18:03:42 +03:00
Anthony Geay
ee9734889c Modif for salome gui without neither NS nor other servers. 2021-02-24 07:18:07 +01:00
jfa
064bf22985 bos #23963 - EDF 22935 : Extrusion3D, submesh problem. Fix groups handling with ticks 2021-02-17 13:18:13 +03:00
vsr
f26bc594ae Merge branch 'occ/19960' 2021-02-15 14:10:07 +03:00
rnv
923a73f295 Build GEOM w/o GUI 2021-02-08 17:31:14 +03:00
jfa
e416f88e14 bos #19960: [CEA 19958] Show/Hide SHAPERSTUDY objects 2021-02-05 19:14:23 +03:00
rnv
d7d68d8f96 Compilation under Windows platform. 2021-02-05 13:23:50 +03:00
Ovidiu MIRCESCU
686c7023c5 Generic creation of a sessionless component. 2021-02-04 15:37:39 +01:00
Ovidiu Mircescu
26386f270f No more toto. 2021-02-03 15:36:57 +01:00
Anthony Geay
81eb14d320 2 servant implementations of GEOM::GEOM_GEN. One with Study and ModuleCatalog retrived from NS (like the beginning), another one with Study and ModulCatalog embedded 2021-02-01 20:08:02 +01:00
vsr
cb793ede66 Merge branch 'vuzlov/20215' 2021-01-07 16:43:53 +03:00
Viktor UZLOV
b980fc7fda bos #20215 Help panels into SALOME for new users 2021-01-07 16:40:30 +03:00
jfa
30bf08e12b Porting to OCCT7.5.0 2020-12-14 15:32:18 +03:00
SALOME
1405980f7e #18963 Minimize compiler warnings 2020-12-08 12:51:31 +03:00
vsr
ea9614aed9 Correct bug in TUI documentation 2020-12-02 15:11:49 +03:00
vsr
1f04a1ae85 Merge branch 'V9_6_BR' 2020-11-11 18:43:27 +03:00
vsr
b5f99c472c Increment version: 9.6.0 2020-10-16 19:06:18 +03:00
Pascal Obry
57e4a74870 Port to use Qt 5.11.x (native on Debian 10).
This only adds some missing #include directives. The changeset has
also been tested on Debian-9 with Qt 5.9.
2020-10-15 14:54:05 +02:00
Pascal Obry
5dfdaa8e0b Style fixes : remove trailing spaces. 2020-10-15 14:53:04 +02:00
jfa
496aa6dc0f [bos #16792] [CEA 16785] Cannot select COMPSOLID. Fix BasicProperties dialog. 2020-10-07 11:08:55 +03:00
jfa
6fbe1acba9 bos #19940: [CEA] Wrong dump offset if join by pipes is unticked. 2020-08-26 15:04:50 +03:00
jfa
bbdad62780 Bos #19916: EDF 21881 - CAD with field can't be exported 2020-08-19 15:28:28 +03:00
jfa
665d9f4816 bos #16247: EDF - Problem of partition 2020-08-17 14:39:23 +03:00
jfa
95c850c1c0 bos #16247: EDF - Problem of partition 2020-08-12 13:52:36 +03:00
jfa
fde5bbfe1c Fix for bos #16261: PipeWithDifferentSections. Use ThruSections algorithm in certain conditions. 2020-08-04 14:24:34 +03:00
jfa
23d3a9b07a Fix for bos #16366 and bos #16182 2020-08-04 13:44:08 +03:00
jfa
08f4a1d3d5 Porting to OCCT 7.4.1dev 2020-07-31 18:36:42 +03:00
rnv
2a3778cbc2 Build with native prerequsites 2020-07-29 15:54:42 +03:00
rnv
7cd67a0174 Build GEOM with OCCT dev version. 2020-07-23 16:18:07 +03:00
rnv
090649639c Fix for '#17888 [CEA 17919] VTK Viewer - Scaling'. 2020-07-13 14:45:26 +03:00
vsr
11cbc17d51 Merge branch 'V9_5_BR' 2020-07-10 18:14:46 +03:00
vsr
01ead53342 bos #19182: Remove redundant 'father' attribute 2020-05-28 15:24:23 +03:00
vsr
8647067a5b bos #19182: Additional fix for CreateFolder() service 2020-05-27 18:08:52 +03:00
jfa
5088f18afd bos #19182: GEOM appears in Object browser when calling SMESH from python 2020-05-27 15:01:53 +03:00
jfa
dd7a8e88ba Fix for bos #19108: t_shape_builder 2020-05-21 13:23:04 +03:00
vsr
c6482451ab Increment version: 9.5.0 2020-05-19 13:29:55 +03:00
jfa
fcc928b687 bos #18341: HOME environment variable 2020-05-13 17:09:57 +03:00
eap
822c54d232 #19078 [CEA] Mesh Group - Group on filter 2020-05-08 21:48:05 +03:00
vsr
436cccec5f bos #19060 [CEA] Fatal error no persistant file when loading SMESH (attempt 2) 2020-05-08 17:32:23 +03:00
eap
49fd9a6330 Prevent processing SHAPERSTUDY objects` 2020-05-07 19:49:06 +03:00
vsr
535033fcd5 bos #19060 [CEA] Fatal error no persistant file when loading SMESH 2020-05-06 16:45:05 +03:00
jfa
c94d2e489e Porting to OCCT 7.4.1 dev 2020-04-30 15:53:38 +03:00
vsr
bb27da6b38 Include SalomeMacros.cmake with NO_POLICY_SCOPE to apply policies 2020-04-20 10:52:58 +03:00
jfa
150483de56 OCC Viewer: correct edges color in wireframe mode 2020-04-17 16:02:27 +03:00
vsr
1c03b6900c Remove CMake warnings: set-up cmake policies globally in SalomeMacros.cmake 2020-04-16 20:13:59 +03:00
vsr
df260abc61 Copyright update 2020 2020-04-15 16:11:04 +03:00
eap
39f7977c42 SHAPERSTUDY: fix case of a group containing the main shape 2020-04-11 01:24:18 +03:00
jfa
13b2d4d02d Time optimization in frame of bos #18939 (Export XAO) 2020-04-07 12:08:33 +03:00
jfa
47c785f741 Publish locally selected subshapes to avoid DumpStudy failure 2020-03-27 14:23:30 +03:00
vsr
54a5d9072f Adapting for OCCT dev (7.5) 2020-03-19 14:25:13 +03:00
eap
43c219aae9 Optimize work with std::map 2020-03-18 15:42:47 +03:00
Pascal Obry
ed0f1a6b82 Porting to ParaView 5.8 2020-03-11 14:36:23 +03:00
jgv
125a3a0c88 Fix of #16366 2020-03-06 15:58:06 +03:00
rnv
16eda1b07a Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/geom 2020-02-25 18:25:08 +03:00
rnv
2ea12bde89 Debug for material colors with OCCT-7.4.0 2020-02-25 18:24:52 +03:00
vsr
d05f7ac43d Merge branch 'shaper2smesh' 2020-02-21 14:50:40 +03:00
jfa
7c35075817 Fix Check Geometry failure. Avoid creation of self-intersecting shape. 2020-01-23 13:30:33 +03:00
vsv
f1da3f8ded Transfer BreakLink from Object to Gen 2019-12-23 14:55:03 +03:00
vsv
e2fe8c1360 Define IsParametrical and BreakLinks methods 2019-12-20 15:54:12 +03:00
rnv
63cf6cca2e Fix for '#18490 GEOM build fail with master branch' issue. 2019-12-18 11:38:29 +03:00
rnv
d07a864e83 Porting to OCCT-7.4.0 2019-12-17 22:17:17 +03:00
vsv
b654dab419 Modification of GEOM interface 2019-12-09 16:11:19 +03:00
vsr
e87935b0f9 Merge branch 'V9_4_BR' 2019-12-06 16:01:05 +03:00
vsr
4784596a38 #18319 [CEA 18318] Display of a field with negative value 2019-11-18 14:13:21 +03:00
vsr
6f0f4ed5d1 #18319 [CEA 18318] Display of a field with negative value 2019-11-18 14:12:24 +03:00
vsr
c9d3c88044 Fix broken link in Developer documentation 2019-11-13 15:14:03 +03:00
vsr
627494a5b0 Fix broken link in Developer documentation 2019-11-13 14:50:13 +03:00
rnv
48e4c0a02d Increment version: 9.4.0 2019-11-06 09:53:18 +03:00
rnv
33502d28ed GEOM in debug mode on Windows 10 with VS 2017. 2019-10-30 20:36:28 +03:00
rnv
000dfcbd77 Additional fix for Geometry documentation. 2019-10-22 15:07:32 +03:00
rnv
004cf4db73 Fix generation of the Geometry User's documentation on Windows. 2019-10-22 12:41:29 +03:00
rnv
eb232fee26 Build Geometry documentation under Windows. 2019-10-07 19:01:50 +03:00
jfa
efa7eecc97 Porting to new OCCT version 2019-09-03 12:25:16 +03:00
rnv
3b33c84634 Porting to opencv-3.2.0. 2019-09-02 20:31:02 +03:00
jfa
9f557687e2 16982 EDF 19511 - Crash when dumping study. Improved fix. 2019-08-14 12:53:30 +03:00
vsr
ca407fcec6 Reverting commit 32564551 as it caused regression with data publication 2019-07-30 11:39:41 +03:00
rnv
9c7a707978 Remove QT4 compatibility: additional commit. 2019-06-19 17:29:51 +03:00
rnv
9157430337 Remove QT4 compatibility. 2019-05-31 15:05:36 +03:00
rnv
3256455164 Fix for "16982 EDF 19511 - Crash when dumping study" issue. 2019-05-28 19:05:05 +03:00
rnv
5410290368 Fix for "16935 [CEA] exception in group creation" issue. 2019-05-14 14:59:35 +03:00
rnv
ee3393d541 Fix for "[CEA]: Windows version: Dump Python: there is an error in the file name generated for geompy.ImportXAO" issue. 2019-05-13 16:41:55 +03:00
vsr
25c737135e Merge branch 'V9_3_BR' 2019-05-06 13:54:38 +03:00
jfa
6c3f954171 bos #16792 [CEA 16785] Cannot select COMPSOLID 2019-04-24 13:30:22 +03:00
rnv
2940ca79a8 Compilation with DEV version of OCCT 2019-04-12 15:02:39 +03:00
vsr
aa818f57a9 Merge branch 'master' into V9_3_BR 2019-04-04 12:57:32 +03:00
jfa
485d7cea0a bos #16700 [EDF] GEOM : Import python file after dump of explode structure from XAO file 2019-04-04 11:53:12 +03:00
vsr
8e439e4b0a Increment version: 9.3.0 2019-03-28 09:58:33 +03:00
vsr
175b357b21 Avoid SIGSEGV in case of incorrectly recorded command dump processing 2019-03-26 14:38:44 +03:00
vsr
a41868ac87 Fix bad dump produced in case if ExtractShapes() function is called with 'FLAT' shape type 2019-03-26 13:31:26 +03:00
jfa
2f5ed2c56a tracker_salome #16492 EDF 18458 - Restoregivensubshapes 2019-03-22 13:39:59 +03:00
jfa
fa02ef2a4f tracker_salome #16694 EDF - Problem with T-Shape 2019-03-22 13:07:57 +03:00
rnv
4558fc1b44 54519: [TC-9.3.0]: SIGSEGV during exit if dimensions are editing 2019-03-22 10:59:36 +03:00
rnv
991d2a1931 Compilation on Windows. 2019-03-13 15:04:23 +03:00
rnv
64c20fc0e7 Run SALOME with UNICODE path on Windows platform. 2019-03-11 13:08:24 +03:00
Paul RASCLE
cccc6496b1 fast subShapes selector for PyQt Clients 2019-03-10 12:58:49 +01:00
vsr
6fc8283dbb Merge branch 'V9_2_2_BR' 2019-03-05 09:46:34 +03:00
vsr
7d2c08f06a Increment version: 9.2.2 2019-02-25 15:57:49 +03:00
mnt
bfd48ef62a Porting to OCCT 7.4 dev 2019-02-22 15:55:49 +03:00
vsr
3d5efd4572 23553: Put back replacement of ABSOLUTE_APPLI_PATH by GEOM_ROOT_DIR
Rollback temporary workaround, done in commit a3a641c0
2019-02-15 16:06:42 +03:00
vsr
ac813fd986 Remove deprecated stuff 2019-02-14 13:57:36 +03:00
vsr
d6f1d8730f Update copyrights 2019-02-14 13:56:18 +03:00
vsr
96bab5d2a8 Increment version: 9.2.1 2019-02-08 14:25:56 +03:00
vsr
7f0efc8881 Correct double quotes 2019-01-14 15:15:51 +03:00
vsr
d90d0665f7 0023647: [CEA 7290] cannot reload XAO file 2018-12-11 10:30:48 +03:00
vsr
1aa43a9db3 Merge branch 'V9_2_BR' 2018-12-10 17:26:42 +03:00
vsr
b6fca18ac3 0023552: Unable to use the contextual menu of Object Browser window
- Another attempt to solve problem with materials sub-menu on desktops like Unity, KDE Plasma etc.
2018-12-06 16:02:00 +03:00
vsr
62e52d34fb Increment version: 9.2.0 2018-11-16 11:14:47 +03:00
vsr
a0fd374702 0054463: Refactor salome_test.py 2018-11-14 20:07:14 +03:00
1748 changed files with 26480 additions and 9647 deletions

97
CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2013-2017 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2013-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -19,41 +19,43 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
INCLUDE(CMakeDependentOption)
# Project name
# ============
# original
PROJECT(SalomeGEOM C CXX)
# Ensure a proper linker behavior:
CMAKE_POLICY(SET CMP0003 NEW)
IF(WIN32)
CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib
ENDIF(WIN32)
# Versioning
# ===========
# Project name, upper case
# upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
SET(${PROJECT_NAME_UC}_MINOR_VERSION 1)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
# Common CMake macros
# ===================
SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
IF(EXISTS ${CONFIGURATION_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
INCLUDE(SalomeMacros)
INCLUDE(SalomeMacros NO_POLICY_SCOPE)
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
ENDIF()
# Versioning
# ===========
SALOME_SETUP_VERSION(9.13.0)
MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \"${${PROJECT_NAME_UC}_GIT_SHA1}\"")
# Find SalomeBootstrap
# ===========
SET(SALOMEBOOTSTRAP_ROOT_DIR $ENV{SALOMEBOOTSTRAP_ROOT_DIR} CACHE PATH "Path to the Salome Bootstrap")
IF(EXISTS ${SALOMEBOOTSTRAP_ROOT_DIR})
FIND_PACKAGE(SalomeBootstrap REQUIRED)
ADD_DEFINITIONS(${SALOMEBOOTSTRAP_DEFINITIONS})
INCLUDE_DIRECTORIES(${SALOMEBOOTSTRAP_INCLUDE_DIRS})
ELSE(EXISTS ${SALOMEBOOTSTRAP_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome Bootstrap, please define SALOMEBOOTSTRAP_ROOT_DIR")
ENDIF(EXISTS ${SALOMEBOOTSTRAP_ROOT_DIR})
# Find KERNEL
# ===========
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
IF(EXISTS ${KERNEL_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
FIND_PACKAGE(SalomeKERNEL REQUIRED)
KERNEL_WITH_CORBA() #check whether KERNEL built with CORBA
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
@ -67,8 +69,6 @@ ENDIF(EXISTS ${KERNEL_ROOT_DIR})
INCLUDE(SalomeSetupPlatform) # From KERNEL
# Always build libraries as shared objects:
SET(BUILD_SHARED_LIBS TRUE)
# Local macros:
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
# User options
# ============
@ -103,6 +103,7 @@ FIND_PACKAGE(SalomeOmniORB REQUIRED)
FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
FIND_PACKAGE(SalomeLibXml2 REQUIRED)
FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C)
FIND_PACKAGE(Eigen3 3.2.5 REQUIRED)
# Other KERNEL optionals:
IF(SALOME_BUILD_TESTS)
@ -121,10 +122,9 @@ ENDIF()
IF(SALOME_BUILD_GUI)
SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
SALOME_GUI_WITH_CORBA() #check whether GUI built with CORBA
SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT
SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_VTKVIEWER SALOME_USE_PV3DVIEWER SALOME_USE_SALOMEOBJECT
OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PYCONSOLE)
ADD_DEFINITIONS(${GUI_DEFINITIONS})
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
@ -139,17 +139,10 @@ ENDIF(SALOME_BUILD_GUI)
##
IF(SALOME_BUILD_GUI)
IF(NOT SALOME_GUI_BUILD_WITH_QT5)
# Qt
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
# PyQt
FIND_PACKAGE(SalomePyQt4 REQUIRED)
ELSE()
# Qt
FIND_PACKAGE(SalomeQt5 REQUIRED)
# PyQt
FIND_PACKAGE(SalomePyQt5 REQUIRED)
ENDIF()
# Qt
FIND_PACKAGE(SalomeQt5 REQUIRED)
# PyQt
FIND_PACKAGE(SalomePyQt5 REQUIRED)
ENDIF(SALOME_BUILD_GUI)
##
@ -158,6 +151,13 @@ ENDIF(SALOME_BUILD_GUI)
FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
SET(CommonGeomLib_ROOT_DIR $ENV{CommonGeomLib_ROOT_DIR} CACHE PATH "Path to the CommonGeomLib tool")
IF(EXISTS ${CommonGeomLib_ROOT_DIR})
FIND_PACKAGE(SalomeCommonGeomLib REQUIRED)
ELSE(EXISTS ${CommonGeomLib_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need the CommonGeomLib tool, please define CommonGeomLib_ROOT_DIR !")
ENDIF(EXISTS ${CommonGeomLib_ROOT_DIR})
IF(SALOME_GEOM_USE_VTK)
FIND_PACKAGE(SalomeVTK REQUIRED)
ADD_DEFINITIONS(-DWITH_VTK)
@ -219,6 +219,16 @@ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOM
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# For salome test
# ===============
SET(GEOM_TEST_DIR ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
IF(SALOME_BUILD_TESTS)
CONFIGURE_FILE(CTestTestfileInstall.cmake.in CTestTestfileInstall.cmake @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
DESTINATION ${GEOM_TEST_DIR}
RENAME CTestTestfile.cmake)
ENDIF()
# Sources
# ========
ADD_SUBDIRECTORY(idl)
@ -227,13 +237,13 @@ ADD_SUBDIRECTORY(adm_local)
ADD_SUBDIRECTORY(resources)
ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(src)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(doc)
IF(SALOME_BUILD_TESTS)
ADD_SUBDIRECTORY(test)
ENDIF()
# Header configuration
# ====================
SALOME_XVERSION(${PROJECT_NAME})
SALOME_CONFIGURE_FILE(GEOM_version.h.in GEOM_version.h INSTALL ${SALOME_INSTALL_HEADERS})
# Configuration export
@ -287,19 +297,21 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
SET(OPENCASCADE_ROOT_DIR "${OPENCASCADE_ROOT_DIR}")
SET(CommonGeomLib_ROOT_DIR "${CommonGeomLib_ROOT_DIR}")
SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
SET(OPENCV_ROOT_DIR "${OPENCV_ROOT_DIR}")
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
SALOME_CONFIGURE_PREPARE(OpenCV OpenCASCADE VTK)
SALOME_CONFIGURE_PREPARE(OpenCV OpenCASCADE CommonGeomLib VTK)
CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
KERNEL_ROOT_DIR GUI_ROOT_DIR OPENCASCADE_ROOT_DIR VTK_ROOT_DIR OPENCV_ROOT_DIR)
KERNEL_ROOT_DIR GUI_ROOT_DIR OPENCASCADE_ROOT_DIR CommonGeomLib_ROOT_DIR
VTK_ROOT_DIR OPENCV_ROOT_DIR)
# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
# Get the relative path of the include directory so
@ -324,8 +336,3 @@ INSTALL(FILES
# Install the export set for use with the install-tree
INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)
# Application tests
INSTALL(FILES CTestTestfileInstall.cmake
DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test
RENAME CTestTestfile.cmake)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2017 CEA/DEN, EDF R&D
# Copyright (C) 2017-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -17,10 +17,11 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
SET(OpenCASCADE_VERSION @OpenCASCADE_VERSION@)
SET(OpenCASCADE_SP_VERSION @OpenCASCADE_SP_VERSION@)
SET(PYTHON_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/python_test_driver.py")
SET(COMPONENT_NAME GEOM)
SET(TIMEOUT 300)
SUBDIRS(examples)
SUBDIRS(xao)
SUBDIRS(examples xao other)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS

12
README
View File

@ -13,7 +13,7 @@ SALOME Geometry module implements the CAD modeling services:
For more information please visit the SALOME platform web site:
<http://www.salome-platform.org/>
<https://www.salome-platform.org/>
=======
License
@ -22,10 +22,6 @@ License
SALOME platform is distributed under the GNU Lesser General Public License.
See COPYING file for more details.
Also, additional information can be found at SALOME platform web site:
<http://www.salome-platform.org/downloads/license/>
============
Installation
============
@ -42,11 +38,7 @@ site:
* Check Release Notes and Software Requirements of the latest SALOME release at
<http://www.salome-platform.org/downloads/current-version/>
* Pre-requisites page at SALOME web site:
<http://www.salome-platform.org/downloads/license/>
<https://github.com/SalomePlatform/.github/wiki/SAT/>
Note: SALOME Geometry module needs SALOME KERNEL and SALOME GUI as
pre-requisites.

View File

@ -1,4 +1,4 @@
# Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2013-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public

2
adm_local/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS

2
adm_local/unix/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2012-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public

2
adm_local/unix/config_files/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS

View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
dnl Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS

2
adm_local/unix/config_files/check_GUI.m4 Executable file → Normal file
View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
dnl Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public

View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
dnl Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public

4
bin/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2012-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -24,6 +24,6 @@ SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS})
# ===============================================================
SET(_bin_scripts
addvars2notebook_GEOM.py geom_setenv.py
addvars2notebook_GEOM.py geom_setenv.py geom_test.py
)
SALOME_INSTALL_SCRIPTS("${_bin_scripts}" ${SALOME_INSTALL_SCRIPT_SCRIPTS})

1
bin/VERSION.in Executable file → Normal file
View File

@ -1,3 +1,4 @@
[SALOME GEOM] : @SALOMEGEOM_VERSION@
[DEVELOPMENT] : @SALOMEGEOM_VERSION_DEV@
[DESCRIPTION] : SALOME Geometry module
[SHA1] : @SALOMEGEOM_GIT_SHA1@

View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
#! /usr/bin/env python3
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public

80
bin/geom_test.py Normal file
View File

@ -0,0 +1,80 @@
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2018-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
import unittest
class TestGeometry(unittest.TestCase):
def setUp(self):
import salome
salome.salome_init()
def processGuiEvents(self):
import salome
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser();
import SalomePyQt
SalomePyQt.SalomePyQt().processEvents()
def test_geometry(self):
"""Quick test for Geometry module"""
print()
print('Testing Geometry module')
from salome.geom import geomBuilder
geompy = geomBuilder.New()
# ---- create box
print('... Create box')
box = geompy.MakeBox(0., 0., 0., 100., 200., 300, theName='box')
self.assertIsNotNone(box)
self.assertEqual(box.GetName(), 'box')
self.processGuiEvents()
# ---- extract shell from box
print('... Extract shell from box')
shells = geompy.SubShapeAll(box, geompy.ShapeType['SHELL'], theName=['shell'])
self.assertEqual(len(shells), 1)
shell = shells[0]
self.assertIsNotNone(shell)
self.assertEqual(shell.GetName(), 'shell')
self.processGuiEvents()
# ---- extract faces from box
print('... Extract faces from box')
faces = geompy.SubShapeAll(box, geompy.ShapeType['FACE'], theName='face')
self.assertEqual(len(faces), 6)
for i, face in enumerate(faces):
self.assertIsNotNone(face)
self.assertEqual(face.GetName(), 'face_{}'.format(i+1))
self.processGuiEvents()
# ---- extract edges from 1st face
print('... Extract edges from 1st face')
edges = geompy.SubShapeAll(faces[0], geompy.ShapeType['EDGE'], theName='edge')
self.assertEqual(len(edges), 4)
for i, edge in enumerate(edges):
self.assertIsNotNone(edge)
self.assertEqual(edge.GetName(), 'edge_{}'.format(i+1))
self.processGuiEvents()
if __name__ == '__main__':
unittest.main()

2
doc/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS

10
doc/salome/CMakeLists.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -20,6 +20,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
ADD_SUBDIRECTORY(tui)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(examples)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(tui)
ADD_SUBDIRECTORY(gui)
ENDIF()

View File

@ -0,0 +1,7 @@
This folder contains example Python scripts which are used in the documentation of Geometry module,
i.e. those mentioned in *.doc files in {root_src}/doc/salome/gui/GEOM/input folder.
These tests are exported into the ${GEOM_ROOT_DIR}/share/doc/salome/examples/GEOM folder and can be
executed with the `salome test` command, as a part of whole testing procedure.
Other Python scripts aimed for testing purposes must be put into the ${root_src}/test folder!

View File

@ -1,7 +1,7 @@
# 3D Sketcher
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -19,31 +19,36 @@
INCLUDE(tests.set)
SET(TEST_REINIT_SALOME "False")
SALOME_CONFIGURE_FILE(tests.py.in tests.py)
SET(TEST_INSTALL_DIRECTORY ${GEOM_TEST_DIR}/examples)
SET(EXAMPLES_INSTALL_DIRECTORY ${SALOME_INSTALL_DOC}/examples/GEOM)
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
IF(SALOME_BUILD_TESTS)
# Install 'salome test' staff
# ---------------------------
INSTALL(FILES CTestTestfileInstall.cmake
DESTINATION ${TEST_INSTALL_DIRECTORY}
RENAME CTestTestfile.cmake)
INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
# Add tests for 'make test'
# -------------------------
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
IF(GEOM_JOIN_TESTS)
ADD_TEST(NAME GEOM_examples COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py tests.py)
ELSE(GEOM_JOIN_TESTS)
FOREACH(test ${GOOD_TESTS})
GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
ADD_TEST(NAME ${testname}
COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${test})
SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/test/test_helper.py ${CMAKE_CURRENT_SOURCE_DIR}/${test})
SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}" LABELS "examples")
ENDFOREACH()
ENDIF(GEOM_JOIN_TESTS)
# install Python scripts
SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/GEOM)
ENDIF()
# Application tests
# Install example scripts and data
# --------------------------------
SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/examples)
INSTALL(FILES ${GOOD_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake
DESTINATION ${TEST_INSTALL_DIRECTORY}
RENAME CTestTestfile.cmake)
INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
IF(SALOME_BUILD_TESTS OR SALOME_BUILD_DOC)
INSTALL(FILES ${GOOD_TESTS} ${BAD_TESTS} DESTINATION ${EXAMPLES_INSTALL_DIRECTORY})
ENDIF()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2015-2017 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2015-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -17,11 +17,13 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(SCRIPTS_DIR "../../../../share/doc/salome/examples/GEOM")
INCLUDE(tests.set)
FOREACH(tfile ${GOOD_TESTS})
GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
SET(TEST_NAME GEOM_${BASE_NAME})
ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile})
SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME})
ADD_TEST(${TEST_NAME} python ${PYTHON_TEST_DRIVER} ${TIMEOUT} ${SCRIPTS_DIR}/${tfile})
SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME};${COMPONENT_NAME}_examples")
ENDFOREACH()

View File

@ -1,7 +1,7 @@
# Geom Field
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,6 +1,6 @@
# --- salome initialization
import salome
salome.salome_init()
salome.salome_init_without_session()
# --- geom Python interface
import GEOM

View File

@ -0,0 +1,212 @@
# Test XYZtoUV and UVtoXYZ methods
import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
import math
import numpy as np
toler = 1e-04
# Create "Horse saddle"
OX = geompy.MakeVectorDXDYDZ(1, 0, 0, 'OX')
OY = geompy.MakeVectorDXDYDZ(0, 1, 0, 'OY')
Sphere_1 = geompy.MakeSphereR(100, 'Sphere_1')
[Edge_1,Edge_2,Edge_3] = geompy.ExtractShapes(Sphere_1, geompy.ShapeType["EDGE"], True)
geompy.addToStudyInFather( Sphere_1, Edge_1, 'Edge_1' )
geompy.addToStudyInFather( Sphere_1, Edge_2, 'Edge_2' )
geompy.addToStudyInFather( Sphere_1, Edge_3, 'Edge_3' )
Rotation_1 = geompy.MakeRotation(Edge_3, OX, 90*math.pi/180.0, 'Rotation_1')
Rotation_2 = geompy.MakeRotation(Rotation_1, OY, 180*math.pi/180.0, 'Rotation_2')
Translation_1 = geompy.MakeTranslation(Rotation_2, 200, 0, 0, 'Translation_1')
Translation_2 = geompy.MakeTranslation(Edge_3, 100, 100, 0, 'Translation_2')
Translation_3 = geompy.MakeTranslation(Translation_2, 0, -200, 0, 'Translation_3')
Filling_1 = geompy.MakeFilling([Translation_2, Edge_3, Translation_3])
geompy.addToStudy(Filling_1, 'Filling_1')
HorseSaddle = geompy.LimitTolerance(Filling_1, toler, 'HorseSaddle')
# Get 100 equidistant points on the "Horse saddle"
CompoundOfVertices = geompy.MakeVertexInsideFace(HorseSaddle, 100, "CompoundOfVertices")
assert(geompy.NumberOfSubShapes(CompoundOfVertices, geompy.ShapeType["VERTEX"]) == 100)
# Extract the vertices
listOfVertices = geompy.ExtractShapes(CompoundOfVertices, geompy.ShapeType["VERTEX"], True)
# Get list of coordinates of all 100 vertices
listOfCoords = []
for aV in listOfVertices:
listOfCoords += geompy.PointCoordinates(aV)
pass
# Test 1: with normalization of parameters
# Convert XYZ to UV
listOfParams_norm = geompy.XYZtoUV(HorseSaddle, listOfCoords, True)
assert(len(listOfParams_norm) == 200)
# Convert UV to XYZ
listOfCoords_new1 = geompy.UVtoXYZ(HorseSaddle, listOfParams_norm, True)
assert(len(listOfCoords_new1) == 300)
# Compare listOfCoords_new with listOfCoords
for (c1, c2) in zip(listOfCoords, listOfCoords_new1):
assert(abs(c1 - c2) < toler)
pass
# Test 2: without normalization of parameters
# Convert XYZ to UV
listOfParams = geompy.XYZtoUV(HorseSaddle, listOfCoords, False)
assert(len(listOfParams) == 200)
# Convert UV to XYZ
listOfCoords_new2 = geompy.UVtoXYZ(HorseSaddle, listOfParams, False)
assert(len(listOfCoords_new2) == 300)
# Compare listOfCoords_new with listOfCoords
for (c1, c2) in zip(listOfCoords, listOfCoords_new2):
assert(abs(c1 - c2) < toler)
pass
# Test 3: Check exceptions throwing if point (XYZ or UV) is out of face
listXYZ_3 = listOfCoords[:3]
listXYZ_3[2] = listXYZ_3[2] + 1.0 # move along OZ
try:
geompy.XYZtoUV(HorseSaddle, listXYZ_3, True)
except RuntimeError:
print(geompy.MeasuOp.GetErrorCode(), ", it's OK")
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'XYZtoUV should raise an exception if input point is out of face'
listUV_2 = [2, 2] # each parameter value should be in [0,1] range (for normalized case)
try:
geompy.UVtoXYZ(HorseSaddle, listUV_2, True)
except RuntimeError:
print(geompy.MeasuOp.GetErrorCode(), ", it's OK")
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'UVtoXYZ should raise an exception if input parameters are out of face'
# parameter U should be in [4.71239, 7.85398] range (on this face, for not normalized case)
# parameter V should be in [0, 1] range (on this face, for not normalized case)
listUV_2 = [10, 10]
try:
geompy.UVtoXYZ(HorseSaddle, listUV_2, True)
except RuntimeError:
print(geompy.MeasuOp.GetErrorCode(), ", it's OK")
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'UVtoXYZ should raise an exception if input parameters are out of face'
# Test 4: Check exceptions in case of invalid data type (wrong length of array or type of elements)
# 1. Length of input array is not divisible by 3 (for XYZtoUV) or by 2 (for UVtoXYZ)
listXYZ_4 = listOfCoords[:4]
assert(len(listXYZ_4) == 4)
try:
geompy.XYZtoUV(HorseSaddle, listXYZ_4, True)
except RuntimeError:
print(geompy.MeasuOp.GetErrorCode(), ", it's OK")
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'XYZtoUV should raise an exception if input list length is not divisible by 3'
listUV_3 = listOfParams[:3]
assert(len(listUV_3) == 3)
try:
geompy.UVtoXYZ(HorseSaddle, listUV_3, True)
except RuntimeError:
print(geompy.MeasuOp.GetErrorCode(), ", it's OK")
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'UVtoXYZ should raise an exception if input list length is not divisible by 2'
# 2. Input array contains data of wrong type
listXYZ_w = ['a', 'b', 'c']
try:
geompy.XYZtoUV(HorseSaddle, listXYZ_w, True)
except Exception:
pass
else:
assert False, 'XYZtoUV should raise TypeError if input list contains not numerical data'
listXYZ_w = [10.0, '10.0', 10.0]
try:
geompy.XYZtoUV(HorseSaddle, listXYZ_w, True)
except Exception:
pass
else:
assert False, 'XYZtoUV should raise TypeError if input list contains not numerical data'
listUV_w = ['a', 'b']
try:
geompy.UVtoXYZ(HorseSaddle, listUV_w, True)
except Exception:
pass
else:
assert False, 'UVtoXYZ should raise TypeError if input list contains not numerical data'
listUV_w = [10.0, '10.0']
try:
geompy.UVtoXYZ(HorseSaddle, listUV_w, True)
except Exception:
pass
else:
assert False, 'UVtoXYZ should raise TypeError if input list contains not numerical data'
# Test 5: a. Translate each of the 100 points by toler*2.0 along the face normal
# and check that the XYZtoUV method fails by raising an exception.
# b. Translate each of the 100 points by toler*0.7 along the face normal
# and check that we obtain a result.
for ii in range(100):
# cc - coordinates of point #ii
cc = listOfCoords[ii*3 : ii*3 + 3]
pnt = geompy.MakeVertex(cc[0], cc[1], cc[2])
normal = geompy.GetNormal(HorseSaddle, pnt)
vv = geompy.VectorCoordinates(normal)
norm = np.linalg.norm(vv)
if norm > toler:
vec = vv / norm
# a. Move cc by toler*2.0 (XYZtoUV should fail)
pp_2tol = [cc[0] + vec[0]*toler*2.0,
cc[1] + vec[1]*toler*2.0,
cc[2] + vec[2]*toler*2.0]
try:
geompy.XYZtoUV(HorseSaddle, pp_2tol)
except RuntimeError:
pass
except Exception:
assert False, 'Unexpected exception raised'
else:
assert False, 'XYZtoUV should raise an exception if input point is out of face'
pass
# b. Move cc by toler*0.7 (XYZtoUV should not fail)
pp_07tol = [cc[0] + vec[0]*toler*0.7,
cc[1] + vec[1]*toler*0.7,
cc[2] + vec[2]*toler*0.7]
UV_pp = geompy.XYZtoUV(HorseSaddle, pp_07tol, False)
# compare with value from listOfParams (computed above)
UV_cc = listOfParams[ii*2 : ii*2 + 2]
for (c1, c2) in zip(UV_pp, UV_cc):
assert(abs(c1 - c2) < toler)
pass
pass
pass

View File

@ -1,7 +1,7 @@
# Creation of PipeTShape
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of DividedDisk
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of DividedCylinder
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Angle
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Using SALOME NoteBook
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder

View File

@ -1,7 +1,7 @@
# Creation of a Point
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Line
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Circle
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of an Ellipse
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of an Arc
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Curve
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Vector
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Plane
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Local Coordinate System
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Surface From Face
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2022-2024 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
import unittest
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
class BasicGeomObjsEx11(unittest.TestCase):
def testNoRaiseOnMakeFaceWires(self):
"""
Work in pair with testRaiseOnMakeFaceWires
"""
pts = [(0,0,0),(1,0,0),(1,1,1e-6),(0,1,0)] # diff with testRaiseOnMakeFaceWires is 1e-6 instead of 1e-5
vertices = [ geompy.MakeVertex(*list(elt)) for elt in pts]
polyline0 = geompy.MakePolyline([ vertices[nodeidx] for nodeidx in range(len(pts)) ], True)
wire_0 = geompy.MakeFaceWires( [ polyline0 ] , isPlanarWanted = True, theName=None, raiseException=True) # isPlanarWanted and raiseException are expected to be True here !
self.assertTrue(wire_0) # wire_0 is expected to be not None because wire has been created and detected to be planar
wire_1 = geompy.MakeFace( polyline0 , isPlanarWanted = True, theName=None, raiseException=True) # isPlanarWanted and raiseException are expected to be True here !
self.assertTrue(wire_1)
def testRaiseOnMakeFaceWires(self):
"""
Work in pair with testNoRaiseOnMakeFaceWires
"""
pts = [(0,0,0),(1,0,0),(1,1,1e-5),(0,1,0)] # diff with testRaiseOnMakeFaceWires is 1e-5 instead of 1e-6
vertices = [ geompy.MakeVertex(*list(elt)) for elt in pts]
polyline0 = geompy.MakePolyline([ vertices[nodeidx] for nodeidx in range(len(pts)) ], True)
# MakeFaceWires is expected to fail here because third point is too far from Oxy plane
self.assertRaises( RuntimeError, geompy.MakeFaceWires, [ polyline0 ] , True, None, True )# isPlanarWanted and raiseException are expected to be True here !
wire_0 = geompy.MakeFaceWires( [ polyline0 ] , isPlanarWanted = True, theName=None, raiseException=False) # returns something bug wire_0 is incorrect
self.assertRaises( RuntimeError, geompy.MakeFace, polyline0 , True, None, True )# isPlanarWanted and raiseException are expected to be True here !
wire_1 = geompy.MakeFace( polyline0 , isPlanarWanted = True, theName=None, raiseException=False) # returns something bug wire_1 is incorrect
if __name__ == '__main__':
unittest.main()

View File

@ -1,7 +1,7 @@
# Partition
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Archimede
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Restore presentation parameters and sub-shapes
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Get shared sub-shapes
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Basic Properties
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Multi Transformation
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Explode on Blocks
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Propagate
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Fuse
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Common
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Cut
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Section
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Bounding Box
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Quadrangle Face
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Hexagonal Solid
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Center of masses
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -0,0 +1,56 @@
# ExtractBOPFailure example
import math
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
### Prepare shapes for Partition
OX = geompy.MakeVectorDXDYDZ(1, 0, 0, theName="OX")
OY = geompy.MakeVectorDXDYDZ(0, 1, 0, theName="OY")
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1, theName="OZ")
Vertex_1 = geompy.MakeVertex(0, 0, 0, theName="Vertex_1")
Vertex_2 = geompy.MakeVertex(10, 0, 0, theName="Vertex_2")
Vertex_3 = geompy.MakeVertex(0, 0.005, 0, theName="Vertex_3")
Vertex_4 = geompy.MakeVertex(10, 0.015, 0, theName="Vertex_4")
Vertex_5 = geompy.MakeVertex(0, 0.02, 0, theName="Vertex_5")
Vertex_6 = geompy.MakeVertex(10, 0.02, 0, theName="Vertex_6")
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2, theName="Line_1")
Line_2 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_4, theName="Line_2")
Line_3 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_6, theName="Line_3")
Extrusion_1 = geompy.MakePrismVecH(Line_1, OY, 1, theName="Extrusion_1")
Extrusion_2 = geompy.MakePrismVecH(Line_2, OZ, 1, theName="Extrusion_2")
Extrusion_3 = geompy.MakePrismVecH(Line_3, OY, -1, theName="Extrusion_3")
Limit_tolerance_1 = geompy.LimitTolerance(Extrusion_2, 0.01, theName="Limit_tolerance_1")
Extrusion_4 = geompy.MakePrismVecH(Extrusion_1, OZ, -1, theName="Extrusion_4")
Extrusion_5 = geompy.MakePrismVecH(Extrusion_3, OZ, -1, theName="Extrusion_5")
Revolution_1 = geompy.MakeRevolution(Limit_tolerance_1, OX, 45*math.pi/180.0, theName="Revolution_1")
### Try Partition
try :
Partition_1 = geompy.MakePartition([Extrusion_4, Extrusion_5, Revolution_1], [], [], [], geompy.ShapeType["SOLID"], 0, [], 0, theName="Partition_1")
except :
print("EXCEPTION: Partition problem")
### Extract failures
(IsValid, ShapeRes, ShapeErrors) = geompy.ExtractBOPFailure([Extrusion_4, Extrusion_5, Revolution_1], theTimer=True, theVerbose=True, theName="InvalidBOPResult")
### Publish incriminated sub-shapes (reflect errors in their names)
for shapeError in ShapeErrors:
list_ids = shapeError.incriminated
list_subs = geompy.SubShapes(ShapeRes, list_ids)
ii = 1
for subshape in list_subs:
geompy.addToStudyInFather( ShapeRes, subshape, 'SubShape_with_%s_%d'%(str(shapeError.error),ii) )
ii = ii+1
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -1,7 +1,7 @@
# Check Compound of Blocks
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -0,0 +1,45 @@
# Check Conformity
import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Vertex_1 = geompy.MakeVertex(-30, -70, 0)
Vertex_2 = geompy.MakeVertex(-30, 50, 0)
Line_1 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_1)
Vertex_3 = geompy.MakeVertex(0, -50, 0)
Vertex_4 = geompy.MakeVertex(-40, -10, 0)
Vertex_5 = geompy.MakeVertex(0, 40, 0)
Arc_1 = geompy.MakeArc(Vertex_5, Vertex_4, Vertex_3)
Vertex_6 = geompy.MakeVertex(10, -50, 4)
Vertex_7 = geompy.MakeVertex(10, -50, 10)
Vertex_8 = geompy.MakeVertex(10, 40, 10)
Arc_1_vertex_3 = geompy.GetSubShape(Arc_1, [3])
Line_2 = geompy.MakeLineTwoPnt(Arc_1_vertex_3, Vertex_6)
Line_3 = geompy.MakeLineTwoPnt(Vertex_6, Vertex_7)
Line_4 = geompy.MakeLineTwoPnt(Vertex_7, Vertex_8)
Vertex_9 = geompy.MakeVertex(15, 40, 10)
Vertex_10 = geompy.MakeVertex(17, 0, 6)
Vertex_11 = geompy.MakeVertex(17, 0, 3)
Line_5 = geompy.MakeLineTwoPnt(Vertex_8, Vertex_9)
Line_6 = geompy.MakeLineTwoPnt(Vertex_9, Vertex_10)
Line_7 = geompy.MakeLineTwoPnt(Vertex_10, Vertex_11)
Arc_1_vertex_2 = geompy.GetSubShape(Arc_1, [2])
Line_8 = geompy.MakeLineTwoPnt(Vertex_11, Arc_1_vertex_2)
Wire_1 = geompy.MakeWire([Arc_1, Line_2, Line_3, Line_4, Line_5, Line_6, Line_7, Line_8], 1e-07)
Wire_2 = geompy.MakeWire([Line_1], 1e-07)
Compound_1 = geompy.MakeCompound([Wire_1, Wire_2])
# Get CheckConformity tool
cc = geompy.CheckConformity(Compound_1)
valid = cc.isValid()
dist = cc.distantShapes()
small = cc.smallEdges()
interfer = cc.interferingSubshapes()
intersect = cc.selfIntersected2D()

View File

@ -1,7 +1,7 @@
# Detect Self-intersections
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Detect Self-intersections fast
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Check Shape
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Prism
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Revolution
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Filling
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Pipe
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a PipeWithDifferentSections
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a PipeWithShellSections
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a PipeShellsWithoutPath
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,6 +1,6 @@
# Creation of a PipeBiNormalAlongVector
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Middle Path
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of Tangent Plane On Face
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

2
doc/salome/examples/complex_objs_ex11.py Executable file → Normal file
View File

@ -1,7 +1,7 @@
# Apply thickness for shell
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -0,0 +1,203 @@
# Curvature of a Face along given direction
import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
import math
import numpy as np
def test_acceptance():
"""
Acceptance test [tuleap29472]
"""
Vector = [0,100,100]
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Cylinder_1 = geompy.MakeCylinderRH(100, 300)
Translation_1 = geompy.MakeTranslation(Cylinder_1, 0, 0, -150)
Vertex_1 = geompy.MakeVertex(100, 0, 0)
Vertex_2 = geompy.MakeVertex(100, -Vector[2], Vector[1])
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2)
Plane_1 = geompy.MakePlane(Vertex_1, Line_1, 2000)
Rotation_1 = geompy.MakeRotation(Translation_1, OZ, 90*math.pi/180.0)# avoid to have degenerated edge across Vertex_1
[Face_1,Face_2,Face_3] = geompy.ExtractShapes(Rotation_1, geompy.ShapeType["FACE"], True)
curvature_29472 = np.array( geompy.VectorCoordinates( geompy.CurvatureOnFace(Face_2, Vertex_1, geompy.MakeVectorDXDYDZ(*Vector))) ).reshape(1,3)
expected_curvature = np.array( [-200.0,0.0,0.0] ).reshape(1,3)
assert( np.isclose( 0.0, np.linalg.norm( curvature_29472 - expected_curvature ) ,rtol=0,atol=1e-5 ) )
Intersection_1 = geompy.MakeSection(Face_2, Plane_1, True)
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
geompy.addToStudy( Translation_1, 'Translation_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Line_1, 'Line_1' )
geompy.addToStudy( Plane_1, 'Plane_1' )
geompy.addToStudy( Rotation_1, 'Rotation_1' )
geompy.addToStudyInFather( Rotation_1, Face_1, 'Face_1' )
geompy.addToStudyInFather( Rotation_1, Face_2, 'Face_2' )
geompy.addToStudyInFather( Rotation_1, Face_3, 'Face_3' )
geompy.addToStudy( Intersection_1, 'Intersection_1' )
angle = math.asin(Vector[2]/math.sqrt(Vector[1]*Vector[1]+Vector[2]*Vector[2]))
tmp = geompy.MakeTranslation(Intersection_1,*[-elt for elt in geompy.PointCoordinates(Vertex_1)])
tmp = geompy.MakeRotation(tmp,OX,-angle)
Intersection_1_OXY = geompy.MakeTranslation(tmp,*geompy.PointCoordinates(Vertex_1))
geompy.addToStudy( Intersection_1_OXY, 'Intersection_1_OXY' )
eps = 0.01
offset = 0.75
p0 = np.array( geompy.PointCoordinates( geompy.MakeVertexOnCurve(Intersection_1_OXY,offset-eps) ) ).reshape(1,3)
p1 = np.array( geompy.PointCoordinates( geompy.MakeVertexOnCurve(Intersection_1_OXY,offset) ) ).reshape(1,3)
p2 = np.array( geompy.PointCoordinates( geompy.MakeVertexOnCurve(Intersection_1_OXY,offset+eps) ) ).reshape(1,3)
assert( np.isclose(0.0,np.linalg.norm(p1- np.array(geompy.PointCoordinates(Vertex_1)).reshape(1,3) ),rtol=0,atol=1e-8) )
p01=(p0+p1)/2
p12=(p1+p2)/2
v0 = (p1-p0)/np.linalg.norm(p1-p0)
v1 = (p2-p1)/np.linalg.norm(p2-p1)
computedRadius = 1/np.linalg.norm((v1-v0)/np.linalg.norm(p12-p01))
# manual detection of radius : https://fr.wikipedia.org/wiki/Courbure_d%27un_arc
circle = geompy.MakeCircle(O,OZ,computedRadius)
circle = geompy.MakeTranslation(circle,100-computedRadius,0,0)
geompy.addToStudy(circle, "expectedCircle")
print("Radius expected is {}".format(computedRadius))
print("Radius obtain by CurvatureOnFace is {}".format(np.linalg.norm(curvature_29472)))
O = geompy.MakeVertex(0, 0, 0, 'O')
OX = geompy.MakeVectorDXDYDZ(1, 0, 0, 'OX')
OY = geompy.MakeVectorDXDYDZ(0, 1, 0, 'OY')
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1, 'OZ')
pXYZ = geompy.MakeVertex(105, 105, 105, 'pXYZ')
pY = geompy.MakeVertex(0, 105, 0, 'pY')
pZ = geompy.MakeVertex(0, 0, 105, 'pZ')
vZ_XY = geompy.MakeVectorDXDYDZ(-1, -1, 1, 'vZ-XY')
vZ_XY2 = geompy.MakeVectorDXDYDZ(-1, -1, 10, 'vZ-XY')
vZ_XY3 = geompy.MakeVectorDXDYDZ(-1, -1, 100, 'vZ-XY')
R = 100.0
# I. Curvature of a Sphere
Sphere_1 = geompy.MakeSphereR(R, 'Sphere_1')
[Sph] = geompy.ExtractShapes(Sphere_1, geompy.ShapeType["FACE"], True, "Sph")
curvature_1 = geompy.CurvatureOnFace(Sph, pXYZ, OX, 'curvature_sph_pXYZ_OX')
curvature_2 = geompy.CurvatureOnFace(Sph, pXYZ, vZ_XY, 'curvature_sph_pXYZ_vt')
curvature_3 = geompy.CurvatureOnFace(Sph, pY, OX, 'curvature_sph_pY_OX')
# All sphere curvature radiuces = R
assert(abs(geompy.BasicProperties(curvature_1)[0] - R) < 1e-07)
assert(abs(geompy.BasicProperties(curvature_2)[0] - R) < 1e-07)
assert(abs(geompy.BasicProperties(curvature_3)[0] - R) < 1e-07)
# Pole
isExcept = False
try:
geompy.CurvatureOnFace(Sph, pZ, OX)
except:
isExcept = True
assert(isExcept)
# Normal direction
isExcept = False
try:
geompy.CurvatureOnFace(Sph, pY, OY)
except:
isExcept = True
assert(isExcept)
# II. Curvature of a Cylinder
Cylinder_1 = geompy.MakeCylinderRH(R, 300, 'Cylinder_1')
[Face_1,Face_2,Face_3] = geompy.ExtractShapes(Cylinder_1, geompy.ShapeType["FACE"], True, "Face")
# Curvature radius of a cylinder along any direction, orthogonal to its Z axis, equal to R
curvature_4 = geompy.CurvatureOnFace(Face_2, pY, OX, 'curvature_cyl_pY_OX')
assert(abs(geompy.BasicProperties(curvature_4)[0] - R) < 1e-07)
# Curvature radius of a cylinder along its Z direction is infinite
curvature_zero = geompy.CurvatureOnFace(Face_2, pY, OZ)
assert(geompy.MeasuOp.GetErrorCode() == "ZERO_CURVATURE")
assert(not curvature_zero)
# Curvature radius of a cylinder along some direction, different from two above
curvature_5 = geompy.CurvatureOnFace(Face_2, pY, vZ_XY, 'curvature_cyl_pY_vZ_XY')
curvature_6 = geompy.CurvatureOnFace(Face_2, pY, vZ_XY2, 'curvature_cyl_pY_vZ_XY2')
curvature_7 = geompy.CurvatureOnFace(Face_2, pY, vZ_XY3, 'curvature_cyl_pY_vZ_XY3')
# R < r5 < r6 < r7
# r5 = 100.01, r6 = 101.0, r7 = 200
r5 = geompy.BasicProperties(curvature_5)[0]
r6 = geompy.BasicProperties(curvature_6)[0]
r7 = geompy.BasicProperties(curvature_7)[0]
assert(R + 1e-07 < r5)
assert(r5 + 1e-07 < r6)
assert(r6 + 1e-07 < r7)
# Projection aborted. Point is out of the face boundaries.
isExcept = False
try:
pXY_Z = geompy.MakeVertex(105, 105, -105, 'pXY_Z')
geompy.CurvatureOnFace(Face_2, pXY_Z, OX, 'curvature_cyl_pXY_Z')
except:
isExcept = True
assert(isExcept)
# Projection aborted (point on axis). Equal distances to many points.
isExcept = False
try:
geompy.CurvatureOnFace(Face_2, O, vZ_XY, 'curvature_cyl_O')
except:
isExcept = True
assert(isExcept)
# Curvature radius of a planar face is infinite
curvature_zero_2 = geompy.CurvatureOnFace(Face_1, pZ, OX)
assert(geompy.MeasuOp.GetErrorCode() == "ZERO_CURVATURE")
assert(not curvature_zero_2)
# III. Curvature of a "Horse saddle"
[Edge_1,Edge_2,Edge_3] = geompy.ExtractShapes(Sphere_1, geompy.ShapeType["EDGE"], True)
geompy.addToStudyInFather( Sphere_1, Edge_1, 'Edge_1' )
geompy.addToStudyInFather( Sphere_1, Edge_2, 'Edge_2' )
geompy.addToStudyInFather( Sphere_1, Edge_3, 'Edge_3' )
Rotation_1 = geompy.MakeRotation(Edge_3, OX, 90*math.pi/180.0, 'Rotation_1')
Rotation_2 = geompy.MakeRotation(Rotation_1, OY, 180*math.pi/180.0, 'Rotation_2')
Translation_1 = geompy.MakeTranslation(Rotation_2, 200, 0, 0, 'Translation_1')
Translation_2 = geompy.MakeTranslation(Edge_3, 100, 100, 0, 'Translation_2')
Translation_3 = geompy.MakeTranslation(Translation_2, 0, -200, 0, 'Translation_3')
Filling_1 = geompy.MakeFilling([Translation_2, Edge_3, Translation_3])
geompy.addToStudy(Filling_1, 'Filling_1')
Vertex_2 = geompy.MakeVertex(100, 0, 0, 'Vertex_2')
curvature_Y = geompy.CurvatureOnFace(Filling_1, Vertex_2, OY, 'curvature_Y')
curvature_Z = geompy.CurvatureOnFace(Filling_1, Vertex_2, OZ, 'curvature_Z')
cury = np.array( geompy.VectorCoordinates(curvature_Y) ).reshape(1,3)
curz = np.array( geompy.VectorCoordinates(curvature_Z) ).reshape(1,3)
cury_expected = np.array( [50,0,0] ).reshape(1,3)
curz_expected = np.array( [-100,0,0] ).reshape(1,3)
assert( np.isclose( 0.0, np.linalg.norm( cury - cury_expected ) ,rtol=0,atol=1e-5 ) )
assert( np.isclose( 0.0, np.linalg.norm( curz - curz_expected ) ,rtol=0,atol=1e-5 ) )
# Normal direction
norm_1 = geompy.GetNormal(Filling_1, Vertex_2, "Normal_1")
isExcept = False
try:
geompy.CurvatureOnFace(Filling_1, Vertex_2, norm_1)
except:
isExcept = True
assert(isExcept)
# acceptance case
test_acceptance()

View File

@ -1,7 +1,7 @@
# Fast intersection
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Check Free Boundaries
import salome
salome.salome_init()
salome.salome_init_without_session()
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Check Free Faces
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Get Non Blocks
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Import/Export
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
@ -45,6 +45,9 @@ geompy.ExportVTK(sphere, f_vtk2, 0.1)
f_xao = os.path.join(tmpdir, "sphere.xao")
geompy.ExportXAO(sphere, [], [], "author", f_xao)
# export sphere to XAO format memory buffer (bytes array)
buff_xao = geompy.ExportXAOMem(sphere, [], [], "author")
# import BREP file
sphere_brep = geompy.ImportBREP(f_brep)
@ -64,6 +67,9 @@ sphere_stl2 = geompy.ImportSTL(f_stl2)
# import XAO file
ok, sphere_xao, sub_shapes, groups, fields = geompy.ImportXAO(f_xao)
# import XAO data from memory buffer (bytes array)
ok_mem, sphere_xao_mem, sub_shapes_mem, groups_mem, fields_mem = geompy.ImportXAOMem(buff_xao)
# clean up
for f in f_brep, f_iges, f_step, f_stl1, f_stl2, f_vtk1, f_vtk2, f_xao:
os.remove(f)

View File

@ -1,7 +1,7 @@
# Inertia
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -0,0 +1,63 @@
# Sample: KindOfShape method for Edges
import salome
from inspect import getfile
from os.path import abspath, dirname, join
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
Vertex_2 = geompy.MakeVertex(50, 100, 0)
Vertex_3 = geompy.MakeVertex(-10, 60, 0)
Vertex_4 = geompy.MakeVertex(0, 100, 0)
Vertex_5 = geompy.MakeVertex(-100, 100, 0)
Vertex_6 = geompy.MakeVertex(-100, 0, 0)
Vertex_7 = geompy.MakeVertex(-200, 0, 0)
Vertex_8 = geompy.MakeVertex(-200, 100, 0)
# create some curves
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2)
Circle_1 = geompy.MakeCircle(Vertex_2, OZ, 50)
Ellipse_1 = geompy.MakeEllipse(Vertex_1, OZ, 200, 100, Line_1)
Arc_1 = geompy.MakeArc(Vertex_2, Vertex_3, Vertex_1)
Curve_1 = geompy.MakeCurveParametric("t", "50*sin(t)", "0", 0, 360, 30, GEOM.Interpolation, True)
Curve_2 = geompy.MakeCurveParametric("-t", "50*cos(t)", "t", 0, 360, 14, GEOM.Bezier, True)
Curve_5 = geompy.MakeInterpol([Vertex_1, Vertex_4, Vertex_5, Vertex_6, Vertex_7, Vertex_8], False, False)
Curve_7 = geompy.MakeBezier([Vertex_5, Vertex_6, Vertex_7, Vertex_8], True)
Curve_8 = geompy.MakeBezier([Vertex_5, Vertex_6, Vertex_1, Vertex_4], False)
# show information for all curves
props = geompy.KindOfShape(Line_1)
print("KindOfShape(Line_1): ", props)
# [SEGMENT, 0.,0.,0., 50.,100.,0.]
props = geompy.KindOfShape(Circle_1)
print("KindOfShape(Circle_1): ", props)
# [CIRCLE, 50.,100.,0., 0.,0.,1., 50.]
props = geompy.KindOfShape(Ellipse_1)
print("KindOfShape(Ellipse_1): ", props)
# [ELLIPSE, 0.,0.,0., 0.,0.,1., 200., 100., 0.44721,0.89443,0., 0.44721,0.89443,0.]
props = geompy.KindOfShape(Arc_1)
print("KindOfShape(Arc_1): ", props)
# [ARC_CIRCLE, 47.5,38.75,0., 0.,0.,1., 61.301, 50.,100.,0., 0.,0.,0.]
props = geompy.KindOfShape(Curve_1)
print("KindOfShape(Curve_1): ", props)
# [CRV_BSPLINE, 0, 3, 33, 31, 0, 31, 0.,0.,0.,..., 4,1,...,1,4]
props = geompy.KindOfShape(Curve_2)
print("KindOfShape(Curve_2): ", props)
# [CRV_BEZIER, 15, 0, 0.,50.,0.,...,-360.,-14.18455,360.]
props = geompy.KindOfShape(Curve_5)
print("KindOfShape(Curve_5): ", props)
# [CRV_BSPLINE, 0, 3, 8, 6, 0, 6, 0.,0.,0.,..., 100.,0.,0.,100.,200.,300.,400.,500., 4,1,1,1,1,4]
props = geompy.KindOfShape(Curve_7)
print("KindOfShape(Curve_7): ", props)
# [CRV_BEZIER, 5, 0, -100.,100.,0., -100.,0.,0., -200.,0.,0., -200.,100.,0., -100.,100.,0.]
props = geompy.KindOfShape(Curve_8)
print("KindOfShape(Curve_8): ", props)
# [CRV_BEZIER, 4, 0, -100.,100.,0., -100.,0.,0., 0.,0.,0., 0.,100.,0.]

View File

@ -0,0 +1,137 @@
# Sample: KindOfShape method for faces, which are results of partitioning of a conical surface with a prism with complex base.
# Faces of the prism are not perpendicular to cone axis, therefore contour-wires of resulting cone fragments are composed of lines and 2-order curves.
import sys
import salome
salome.salome_init()
import salome_notebook
notebook = salome_notebook.NoteBook()
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
def approximatelyEqual(a, b, epsilon = 1e-5):
return abs(a - b) <= ((abs(b) if (abs(a) < abs(b)) else abs(a)) * epsilon)
def assertShapeKindEquals(iShapeInfo, iKind):
assert (len(iShapeInfo) > 0), "Yielded data array is empty."
assert (iShapeInfo[0] == iKind), f"Expected shape kind is {iKind}, but yielded kind is {iShapeInfo[0]}."
def assertConePropsEqual(iShapeName, iShapeInfo, iExpectedShapeInfo):
assertShapeKindEquals(iShapeInfo, geompy.kind.CONE2D)
assert (len(iShapeInfo) == len(iExpectedShapeInfo)), f"{iShapeName}: Yielded data array is of unexpected length."
for idx in range(1, len(iShapeInfo)):
assert (approximatelyEqual(iShapeInfo[idx], iExpectedShapeInfo[idx])), f"{iShapeName}: Yielded data array element is not equal to the expected value."
def assertConeInfoEquals(iFace, iExpectedShapeInfo, iAddRestoredConeToStudy = False):
ShapeInfo = geompy.KindOfShape(iFace)
print("ShapeInfo of " + iFace.GetName() + " = ", end = "")
print(ShapeInfo, ', ')
assertConePropsEqual(iFace.GetName(), ShapeInfo, iExpectedShapeInfo)
if (iAddRestoredConeToStudy):
BottomLidCenter = geompy.MakeVertex(ShapeInfo[1], ShapeInfo[2], ShapeInfo[3])
AxisAuxPnt = geompy.MakeVertex(ShapeInfo[1] + ShapeInfo[4], ShapeInfo[2] + ShapeInfo[5], ShapeInfo[3] + ShapeInfo[6])
Axis = geompy.MakeVector(BottomLidCenter, AxisAuxPnt)
R1 = ShapeInfo[7] # Bottom lid radius.
R2 = ShapeInfo[8] # Top lid radius.
H = ShapeInfo[9]
RestoredCone = geompy.MakeCone(BottomLidCenter, Axis, R1, R2, H)
geompy.addToStudy(RestoredCone, iFace.GetName() + '__RestoredCone')
# iExpectedConeFragmentShapeInfos is a dictionary of [IndexOfFace, ExpectedShapeInfoOfFace]. IndexOfFace is zero-based index, not one-based one as in Shaper GUI!
def partitionConeAndAssertShapeInfosEqual(iCone, iPartitioningShape, iExpectedConeFragmentShapeInfos, iAddResultsToStudy):
PartitionedCone = geompy.MakePartition([iCone], [iPartitioningShape], [], [], geompy.ShapeType["FACE"], 0, [], 0)
if (iAddResultsToStudy):
geompy.addToStudy(PartitionedCone, "Partitioned" + iCone.GetName())
ConeFragments = geompy.ExtractShapes(PartitionedCone, geompy.ShapeType["FACE"], True)
ConeFragmentsIdxs = iExpectedConeFragmentShapeInfos.keys()
for ConeFragmentIdx in ConeFragmentsIdxs:
assert (ConeFragmentIdx < len(ConeFragments)), f"Num of faces, {iCone.GetName()} is partitioned into, <= {ConeFragmentIdx} (zero-based index)."
ConeFragment = ConeFragments[ConeFragmentIdx]
ConeFragmentName = f"Partitioned{iCone.GetName()}_Face_{ConeFragmentIdx+1}" # Add index to a name as Shaper GUI does.
if (iAddResultsToStudy):
geompy.addToStudyInFather(PartitionedCone, ConeFragment, ConeFragmentName)
else:
ConeFragment.SetName(ConeFragmentName)
assertConeInfoEquals(ConeFragment, iExpectedConeFragmentShapeInfos[ConeFragmentIdx], iAddResultsToStudy)
geompy = geomBuilder.New()
OriginalConeBaseCenter = geompy.MakeVertex(100, 130, -60)
OriginalConeAxisAuxPnt = geompy.MakeVertex(100, 230, 40)
OriginalConeAxis = geompy.MakeVector(OriginalConeBaseCenter, OriginalConeAxisAuxPnt)
OriginalCone = geompy.MakeCone(OriginalConeBaseCenter, OriginalConeAxis, 100, 50, 300)
PrismSubstrateCenter = geompy.MakeVertex(100, 1000, 50)
PrismDirAuxPnt = geompy.MakeVertex(100, 950, 50)
PrismDir = geompy.MakeVector(PrismSubstrateCenter, PrismDirAuxPnt)
PrismSubstrate = geompy.MakeDiskPntVecR(PrismSubstrateCenter, PrismDir, 100)
sk = geompy.Sketcher2D()
sk.addPoint(0.395986, 43.346713)
sk.addSegmentAbsolute(66.321537, 41.733575)
sk.addSegmentAbsolute(80.619408, -2.852314)
sk.addSegmentAbsolute(67.641539, -38.565150)
sk.addSegmentAbsolute(22.193602, -56.632163)
sk.addSegmentAbsolute(-19.060136, -51.084351)
sk.addSegmentAbsolute(-60.823572, 34.825751)
sk.addSegmentAbsolute(-13.047004, 55.727527)
sk.close()
PrismBase = sk.wire(PrismSubstrate)
Prism = geompy.MakePrismVecH(PrismBase, PrismDir, 1400)
geompy.addToStudy( OriginalConeBaseCenter, 'OriginalConeBaseCenter' )
geompy.addToStudy( OriginalConeAxisAuxPnt, 'OriginalConeAxisAuxPnt' )
geompy.addToStudy( OriginalConeAxis, 'OriginalConeAxis' )
geompy.addToStudy( OriginalCone, 'OriginalCone' )
geompy.addToStudy( PrismSubstrateCenter, 'PrismSubstrateCenter' )
geompy.addToStudy( PrismDirAuxPnt, 'PrismDirAuxPnt' )
geompy.addToStudy( PrismDir, 'PrismDir' )
geompy.addToStudy( PrismSubstrate, 'PrismSubstrate' )
geompy.addToStudy( PrismBase, 'PrismBase' )
geompy.addToStudy( Prism, 'Prism' )
# Test on the original cone
ExpectedOriginalConeFragmentsShapeInfos = {
3: ["CONE2D", 100.0, 215.76160602318674, 25.761606023186744, 0.0, 0.7071067811865475, 0.7071067811865475, 79.7857956051852, 54.62305376134459, 150.9764510630437],
5: ["CONE2D", 100.0, 129.99999999999753, -60.000000000002466, 0.0, 0.7071067811865475, 0.7071067811865475, 100.00000000000058, 69.82277418813575, 181.06335487118898],
11: ["CONE2D", 100.0, 216.57653245407857, 26.57653245407856, 0.0, 0.7071067811865475, 0.7071067811865475, 79.59371560336794, 52.95933239773038, 159.80629923382543]
}
partitionConeAndAssertShapeInfosEqual(OriginalCone, Prism, ExpectedOriginalConeFragmentsShapeInfos, True)
# Test on isotropically scaled cone. Non-isotropical scaling does not preserve shape kind - it is desired behavior.
ScaledCone = geompy.MakeScaleTransform(OriginalCone, OriginalConeAxisAuxPnt, 2)
ScaledCone.SetName('ScaledCone')
ExpectedScaledConeFragmentsShapeInfos = {
4: ["CONE2D", 100.0, 29.9999999999999, -160.00000000000009, 0.0, 0.7071067811865475, 0.7071067811865475, 200.00000000000003, 162.64508449690112, 224.1294930185934],
6: ["CONE2D", 100.0, 262.09898500769475, 72.09898500769472, 0.0, 0.7071067811865475, 0.7071067811865475, 145.2937445981814, 120.13428858458612, 150.95673608157182],
12: ["CONE2D", 100.0, 262.8999708414969, 72.8999708414969, 0.0, 0.7071067811865475, 0.7071067811865475, 145.10495042660943, 117.46838914559419, 165.8193676860916]
}
partitionConeAndAssertShapeInfosEqual(ScaledCone, Prism, ExpectedScaledConeFragmentsShapeInfos, False)
# Test on a cone, mirrored relative to a point.
PntMirroredCone = geompy.MakeMirrorByPoint(OriginalCone, OriginalConeAxisAuxPnt)
PntMirroredCone.SetName('PntMirroredCone')
ExpectedPntMirroredConeFragmentsShapeInfos = {
2: ["CONE2D", 100.0, 229.8712015945071, 39.87120159450711, -0.0, -0.7071067811865475, -0.7071067811865475, 76.39941588513841, 51.25530645152799, 150.8646566016625],
7: ["CONE2D", 100.0, 330.0, 140.0, -0.0, -0.7071067811865475, -0.7071067811865475, 100.0, 71.73019727352477, 169.61881635885143],
10: ["CONE2D", 100.0, 249.15532313133338, 59.15532313133339, -0.0, -0.7071067811865475, -0.7071067811865475, 80.9447269211102, 51.428754043115056, 177.09583726797095]
}
partitionConeAndAssertShapeInfosEqual(PntMirroredCone, Prism, ExpectedPntMirroredConeFragmentsShapeInfos, False)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -1,7 +1,7 @@
# Minimal Distance
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Normal to a Face
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Using SALOME NoteBook
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Point Coordinates
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# 2D polyline
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Box
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -3,7 +3,7 @@
import math
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Sphere
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Torus
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Cone
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Disk
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Creation of a Rectangle
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

2
doc/salome/examples/repairing_operations_ex01.py Executable file → Normal file
View File

@ -1,7 +1,7 @@
# Shape Processing
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Suppress Faces
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Close Contour
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Suppress Internal Wires
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

View File

@ -1,7 +1,7 @@
# Suppress Holes
import salome
salome.salome_init()
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()

Some files were not shown because too many files have changed in this diff Show More