From: jfa Date: Mon, 27 May 2024 19:11:28 +0000 (+0100) Subject: Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=HEAD;hp=14e1a694c4cf249fe205a39c099482bc5b28a6e5;p=modules%2Fgeom.git Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM GEOM_IOperations.hxx) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c34047f..36be15fc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,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) diff --git a/doc/salome/examples/kind_of_shape_cone.py b/doc/salome/examples/kind_of_shape_cone.py new file mode 100644 index 000000000..5f1acd04b --- /dev/null +++ b/doc/salome/examples/kind_of_shape_cone.py @@ -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() diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 606c3a2a9..467f2029e 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -76,6 +76,7 @@ SET(GOOD_TESTS get_non_blocks.py import_export.py inertia.py + kind_of_shape_cone.py min_distance.py curvature_face.py normal_face.py diff --git a/doc/salome/examples/topological_geom_objs_ex02.py b/doc/salome/examples/topological_geom_objs_ex02.py index 5e1c28497..bdc20c364 100644 --- a/doc/salome/examples/topological_geom_objs_ex02.py +++ b/doc/salome/examples/topological_geom_objs_ex02.py @@ -26,3 +26,32 @@ id_wire = geompy.addToStudy(wire,"Wire") # display the wire gg.createAndDisplayGO(id_wire) + +# Create a wire from edges that are not connected to each other. +# Given tolerance should cover the gaps to build connected wire. +# Three different modes to do that are possible. +gap = 1 +tolerance = gap +px_gap = geompy.MakeVertex(100. + gap, 0. , 0. ) +py_gap = geompy.MakeVertex(0. , 100. + gap, 0. ) +vxy_gap = geompy.MakeVector(px_gap, py_gap) + +# 1. Join edges by fixing tolerance +wire_ft = geompy.MakeWire([vxy_gap, arc], tolerance, "wire_fixed_tolerance") +# final wire tolerance will be near the half of the gap (0.5) +print(geompy.Tolerance(wire_ft)[5]) +assert(abs(geompy.Tolerance(wire_ft)[5] - 0.5) < 1e-04) + +# 2. Join edges by changing their underlying curves (but keeping curve types) +# This functionality is available in TUI only. +wire_cc = geompy.MakeWireConstCurveType([vxy_gap, arc], tolerance, "wire_const_curve_type") +# final wire tolerance will stay small +print(geompy.Tolerance(wire_cc)[5]) +assert(geompy.Tolerance(wire_cc)[5] < 1e-04) + +# 3. Join edges by changing their underlying curves (approximating with b-splines) +# This functionality is available in TUI only. +wire_ap = geompy.MakeWireWithMode([vxy_gap, arc], tolerance, GEOM.WBM_Approximation, "wire_approximated_curves") +# final wire tolerance will stay small +print(geompy.Tolerance(wire_ap)[5]) +assert(geompy.Tolerance(wire_ap)[5] < 1e-04) diff --git a/doc/salome/examples/topological_geom_objs_ex03.py b/doc/salome/examples/topological_geom_objs_ex03.py index a99f52369..00062de9b 100644 --- a/doc/salome/examples/topological_geom_objs_ex03.py +++ b/doc/salome/examples/topological_geom_objs_ex03.py @@ -47,12 +47,37 @@ face5 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(cut, [5]), geompy.Get geompy.GetSubShape(cut, [11]), geompy.GetSubShape(cut, [3]), geompy.GetSubShape(cut, [13]), geompy.GetSubShape(cut, [3])]) +# create circle from 3 points +pCirc1 = geompy.MakeVertex(17.274575, 63.776413, 50.610737) +pCirc2 = geompy.MakeVertex(37.5, 49.081782, 127.552826) +pCirc3 = geompy.MakeVertex(62.5, 78.471044, 50.610737) +Circle_1 = geompy.MakeCircleThreePnt(pCirc1, pCirc2, pCirc3) +listE = [] +listE.append(Circle_1) + +# create list of points +listV = [] +pV1 = geompy.MakeVertex(64.694631, 85.225425, 64.54915) +listV.append(pV1) +pV2 = geompy.MakeVertex(11.528956, 67.95085, 95.45085) +listV.append(pV2) +pV3 = geompy.MakeVertex(36.233192, 82.369878, 102.699525) +listV.append(pV3) +pV4 = geompy.MakeVertex(35.305369, 85.225425, 64.54915) +listV.append(pV4) +pV5 = geompy.MakeVertex(50, 75.355339, 115.355339) +listV.append(pV5) + +# create face from edges and points +face6 = geompy.MakeWrappedFace(listE, listV, 1e-5) + # add objects in the study id_face1 = geompy.addToStudy(face1,"Face1") id_face2 = geompy.addToStudy(face2,"Face2") id_face3 = geompy.addToStudy(face3,"Face3") id_face4 = geompy.addToStudy(face4,"Face4") id_face5 = geompy.addToStudy(face5,"Face5") +id_face6 = geompy.addToStudy(face5,"Face6") # display the faces gg.createAndDisplayGO(id_face1) @@ -70,3 +95,6 @@ gg.setTransparency(id_face4,0.2) gg.createAndDisplayGO(id_face5) gg.setDisplayMode(id_face5,1) gg.setTransparency(id_face5,0.2) +gg.createAndDisplayGO(id_face6) +gg.setDisplayMode(id_face6,1) +gg.setTransparency(id_face6,0.2) diff --git a/doc/salome/gui/GEOM/input/creating_wire.doc b/doc/salome/gui/GEOM/input/creating_wire.doc index 917332160..858fb29f6 100644 --- a/doc/salome/gui/GEOM/input/creating_wire.doc +++ b/doc/salome/gui/GEOM/input/creating_wire.doc @@ -29,7 +29,7 @@ connect in the middle of the gap. \image html wiresn.png "Wire" -Our TUI Scripts provide you with useful examples of creation of -\ref tui_creation_wire "Advanced Geometric Objects". +Our TUI Scripts provide you with useful examples of +\ref tui_creation_wire "Creation of a Wire". */ diff --git a/doc/salome/gui/GEOM/input/tui_kind_of_shape.doc b/doc/salome/gui/GEOM/input/tui_kind_of_shape.doc index f8219bb5e..157bc4389 100644 --- a/doc/salome/gui/GEOM/input/tui_kind_of_shape.doc +++ b/doc/salome/gui/GEOM/input/tui_kind_of_shape.doc @@ -4,4 +4,6 @@ \tui_script{kind_of_shape.py} +\tui_script{kind_of_shape_cone.py} + */ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index f81c92cee..d1428637a 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -220,6 +220,29 @@ module GEOM CC_LE ///< Less then or equal to }; + /*! + * \brief Wire construction mode. Regulates the way gaps are closed. + * + * Is used in function GEOM_IShapesOperations.MakeWire() + */ + enum wire_build_mode + { + /*! Do not change curves, just enlarge wire tolerance to cover the gaps */ + WBM_FixTolerance, + + /*! + * Replace curves, neighbour to the gap, + * with BSplines, connecting in the middle of the gap + */ + WBM_Approximation, + + /*! + * Replace curves, neighbour to the gap, with new curves of the same + * type and close parameters, connecting in the middle of the gap + */ + WBM_KeepCurveType + }; + /*! * \brief Object creation parameters * @@ -2034,10 +2057,12 @@ module GEOM * \param theEdgesAndWires List of edge and/or wires. * \param theTolerance Maximum distance between vertices, that will be merged. * Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()). + * \param theMode Mode of gaps filling. * \return New GEOM_Object, containing the created wire. */ GEOM_Object MakeWire (in ListOfGO theEdgesAndWires, - in double theTolerance); + in double theTolerance, + in wire_build_mode theMode); /*! * \brief Create a face on the given wire. @@ -2066,6 +2091,17 @@ module GEOM GEOM_Object MakeFaceFromSurface(in GEOM_Object theFace, in GEOM_Object theWire); + /** + * \brief Create non planar face with list of edges and list of vertices + * \param theEdges list of Edges(must be closed but not nesessarily belong to the same plane) . + * \param theVertices list of vertices through which the result face must pass. + * \param theTolerance tolerance. + * \return New GEOM_Object, containing the created face. + */ + GEOM_Object MakeWrappedFace(in ListOfGO theEdges, + in ListOfGO theVertices, + in double theTolerance); + /*! * \brief Create a face from a set of edges with the given constraints. * \param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples): diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 1dae0436a..76bb5fbd7 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -32,6 +32,7 @@ SET( _res_files GEOMDS_Resources ShHealing Y14.5M-2009.ttf + action_assets.json 3dsketch.png isoline.png isoline_v.png @@ -319,7 +320,3 @@ SALOME_CONFIGURE_FILE(GEOMCatalog.xml.in GEOMCatalog.xml INSTALL ${SALOME_GEOM_I SALOME_CONFIGURE_FILE(SalomeApp.xml.in SalomeApp.xml INSTALL ${SALOME_GEOM_INSTALL_RES_DATA}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml RENAME SalomeAppSL.xml DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA}) SALOME_CONFIGURE_FILE(Plugin.in Plugin INSTALL ${SALOME_GEOM_INSTALL_RES_DATA}) - - - - diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index d6d078224..25cac3677 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -111,4 +111,201 @@
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/resources/action_assets.json b/resources/action_assets.json new file mode 100644 index 000000000..e73b22e01 --- /dev/null +++ b/resources/action_assets.json @@ -0,0 +1,3283 @@ +{ + "GEOM/AdvancedGEOM/DividedCylinder": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Divided Cylinder", + "tooltip": "Divided Cylinder" + }, + "fr": { + "name": "Cylinder prédécoupé", + "tooltip": "Cylinder prédécoupé" + }, + "ja": { + "name": "分割シリンダ", + "tooltip": "分割シリンダ" + } + } + }, + "GEOM/AdvancedGEOM/DividedDisk": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Divided Disk", + "tooltip": "Divided Disk" + }, + "fr": { + "name": "Disque prédécoupé", + "tooltip": "Disque prédécoupé" + }, + "ja": { + "name": "分割ディスク", + "tooltip": "分割ディスク" + } + } + }, + "GEOM/AdvancedGEOM/SmoothingSurface": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Smoothing Surface", + "tooltip": "Smoothing Surface" + }, + "fr": { + "name": "Ajustement de surface", + "tooltip": "Ajustement de surface" + }, + "ja": { + "name": "表面の平滑化", + "tooltip": "表面のスムージング" + } + } + }, + "GEOM/AdvancedGEOM/TShape_Basic": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Pipe TShape", + "tooltip": "Create new Pipe TShape object" + }, + "fr": { + "name": "Tuyau en T", + "tooltip": "Créer un tuyau en T" + }, + "ja": { + "name": "T型パイプを作成", + "tooltip": "T型パイプを作成" + } + } + }, + "GEOM/BREPPlugin/Export_BREP": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export BREP", + "tooltip": "Export BREP" + }, + "fr": { + "name": "Exporter BREP", + "tooltip": "Exporter BREP" + }, + "ja": { + "name": "BREPエキスポート", + "tooltip": "BREPエキスポート" + } + } + }, + "GEOM/BREPPlugin/Import_BREP": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import BREP", + "tooltip": "Import BREP" + }, + "fr": { + "name": "Importer BREP", + "tooltip": "Importer BREP" + }, + "ja": { + "name": "BREPインポート", + "tooltip": "BREPインポート" + } + } + }, + "GEOM/IGESPlugin/Export_IGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export IGES", + "tooltip": "Export IGES" + }, + "fr": { + "name": "Exporter IGES", + "tooltip": "Exporter IGES" + }, + "ja": { + "name": "IGESエクスポート", + "tooltip": "IGESエクスポート" + } + } + }, + "GEOM/IGESPlugin/Import_IGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import IGES", + "tooltip": "Import IGES" + }, + "fr": { + "name": "Importer IGES", + "tooltip": "Importer IGES" + }, + "ja": { + "name": "IGESインポート", + "tooltip": "IGESインポート" + } + } + }, + "GEOM/Isolines/Decrease number": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Decrease number of isolines", + "tooltip": "Decrease number of isolines" + }, + "fr": { + "name": "Diminuer le nombre d'isolignes", + "tooltip": "Diminuer le nombre d'isolignes" + }, + "ja": { + "name": "等値線の数を減らす", + "tooltip": "等値線の数を減らす" + } + } + }, + "GEOM/Isolines/Increase number": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Increase number of isolines", + "tooltip": "Increase number of isolines" + }, + "fr": { + "name": "Augmenter le nombre d'isolignes", + "tooltip": "Augmenter le nombre d'isolignes" + }, + "ja": { + "name": "等値線の数を増やす", + "tooltip": "等値線の数を増やす" + } + } + }, + "GEOM/STB_3DSKETCH": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "3D Sketch", + "tooltip": "Create 3D sketch" + }, + "fr": { + "name": "Esquisse 3D", + "tooltip": "Créer une esquisse 3D" + }, + "ja": { + "name": "3D スケッチ", + "tooltip": "3Dスケッチを作成" + } + } + }, + "GEOM/STB_ALL_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Select All", + "tooltip": "Select all Objects" + }, + "fr": { + "name": "Sélectionner tout", + "tooltip": "Choisir tous les objets" + }, + "ja": { + "name": "全選択", + "tooltip": "すべてのオブジェクトを選択" + } + } + }, + "GEOM/STB_ANNOTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Annotation", + "tooltip": "Annotation" + }, + "fr": { + "name": "Annotation", + "tooltip": "Annotation" + }, + "ja": { + "name": "注記", + "tooltip": "注記" + } + } + }, + "GEOM/STB_ARC": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Arc", + "tooltip": "Create an arc" + }, + "fr": { + "name": "Arc", + "tooltip": "Créer un arc" + }, + "ja": { + "name": "円弧", + "tooltip": "円弧を作成" + } + } + }, + "GEOM/STB_ARCHIMEDE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Archimede", + "tooltip": "Archimede operation" + }, + "fr": { + "name": "Archimède", + "tooltip": "Opération archimède " + }, + "ja": { + "name": "アルキメデスの螺旋", + "tooltip": "アルキメデス法で水位面を作成します。" + } + } + }, + "GEOM/STB_BASIC_PROPS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Basic Properties", + "tooltip": "Show basic properties of the shape" + }, + "fr": { + "name": "Propriétés de base ", + "tooltip": "Montrer les propriétés de base de l'objet" + }, + "ja": { + "name": "基本プロパティ", + "tooltip": "オブジェクトの基本プロパティを表示" + } + } + }, + "GEOM/STB_BND_BOX": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Bounding Box", + "tooltip": "Compute bounding box of the shape" + }, + "fr": { + "name": "Boîte englobante", + "tooltip": "Calculer la boîte englobante de l'objet" + }, + "ja": { + "name": "境界ボックス", + "tooltip": "オブジェクトの境界ボックスを計算" + } + } + }, + "GEOM/STB_BOX": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Box", + "tooltip": "Create a box" + }, + "fr": { + "name": "Boîte", + "tooltip": "Créer une boîte" + }, + "ja": { + "name": "ボックス", + "tooltip": "ボックスを作成" + } + } + }, + "GEOM/STB_BRING_TO_FRONT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Bring To Front", + "tooltip": "Bring To Front" + }, + "fr": { + "name": "Afficher au premier plan", + "tooltip": "Afficher au premier plan" + }, + "ja": { + "name": "手前に表示", + "tooltip": "手前に表示します。" + } + } + }, + "GEOM/STB_CHAMFER": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Chamfer", + "tooltip": "Create a chamfer" + }, + "fr": { + "name": "Chanfrein", + "tooltip": "Créer un chanfrein" + }, + "ja": { + "name": "面取り", + "tooltip": "面取りを作成" + } + } + }, + "GEOM/STB_CHANGE_ORIENTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Change Orientation", + "tooltip": "Change orientation" + }, + "fr": { + "name": "Changer l'orientation", + "tooltip": "Changer l'orientation" + }, + "ja": { + "name": "向きの変更", + "tooltip": "向きを変更します。" + } + } + }, + "GEOM/STB_CHECK": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Check Shape", + "tooltip": "Check shape validity" + }, + "fr": { + "name": "Contrôler un objet", + "tooltip": "Contrôler une forme" + }, + "ja": { + "name": "オブジェクトの確認", + "tooltip": "形状の妥当性を確認" + } + } + }, + "GEOM/STB_CHECK_COMPOUND": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Check Compound of Blocks", + "tooltip": "Check compound of blocks" + }, + "fr": { + "name": "Contrôler un assemblage de blocs", + "tooltip": "Contrôler un assemblage de blocs" + }, + "ja": { + "name": "ブロックのアセンブリチェック", + "tooltip": "ブロックのアセンブリチェック" + } + } + }, + "GEOM/STB_CHECK_FREE_BNDS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Check Free Boundaries", + "tooltip": "Check free boundaries" + }, + "fr": { + "name": "Contrôler les contours libres", + "tooltip": "Vérifier les contours libres" + }, + "ja": { + "name": "自由境界の確認", + "tooltip": "自由境界をチェック" + } + } + }, + "GEOM/STB_CHECK_FREE_FACES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Check Free Faces", + "tooltip": "Check free faces" + }, + "fr": { + "name": "Contrôler les faces libres", + "tooltip": "Contrôler les faces libres" + }, + "ja": { + "name": "フリー面の確認", + "tooltip": "フリーフェースチェック" + } + } + }, + "GEOM/STB_CHECK_GEOMETRY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Check Geometry", + "tooltip": "Check Geometry" + }, + "fr": { + "name": "Contrôler la géométrie", + "tooltip": "Contrôler la géométrie" + }, + "ja": { + "name": "ジオメトリチェック", + "tooltip": "ジオメトリチェック" + } + } + }, + "GEOM/STB_CHECK_SELF_INTERSECTIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Detect Self-intersections", + "tooltip": "Detect Self-intersections" + }, + "fr": { + "name": "Détections des auto-intersections", + "tooltip": "Détecte les auto-intersections" + }, + "ja": { + "name": "自己交差の確認", + "tooltip": "自己交差の確認" + } + } + }, + "GEOM/STB_CIRCLE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Circle", + "tooltip": "Create a circle" + }, + "fr": { + "name": "Cercle", + "tooltip": "Créer un cercle" + }, + "ja": { + "name": "円", + "tooltip": "円を作成" + } + } + }, + "GEOM/STB_CLOSE_CONTOUR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Close Contour", + "tooltip": "Perform close contour" + }, + "fr": { + "name": "Fermer le contour", + "tooltip": "Fermer le contour" + }, + "ja": { + "name": "輪郭を閉じる", + "tooltip": "スケッチを終了" + } + } + }, + "GEOM/STB_CLS_BRING_TO_FRONT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Clear Top Level State", + "tooltip": "Clear Top Level State" + }, + "fr": { + "name": "Effacer les objets mis au premier plan", + "tooltip": "Effacer les objets mis au premier plan" + }, + "ja": { + "name": "トップ レベルの状態をクリア", + "tooltip": "フォア グラウンドでオブジェクトを削除します。" + } + } + }, + "GEOM/STB_COMMON": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Common", + "tooltip": "Common" + }, + "fr": { + "name": "Intersection", + "tooltip": "Intersection" + }, + "ja": { + "name": "共有領域", + "tooltip": "共有領域" + } + } + }, + "GEOM/STB_COMPOUND": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Compound", + "tooltip": "Build a compound" + }, + "fr": { + "name": "Assemblage", + "tooltip": "Construire un assemblage" + }, + "ja": { + "name": "コンパウンド", + "tooltip": "アセンブリをビルド" + } + } + }, + "GEOM/STB_COMPOUND_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Compound", + "tooltip": "Select only a Compounds" + }, + "fr": { + "name": "Assemblage", + "tooltip": "Ne choisir que des assemblages" + }, + "ja": { + "name": "コンパウンド", + "tooltip": "アセンブリのみを選択" + } + } + }, + "GEOM/STB_CONE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Cone", + "tooltip": "Create a cone" + }, + "fr": { + "name": "Cône", + "tooltip": "Créer un cône" + }, + "ja": { + "name": "円錐", + "tooltip": "円錐を作成" + } + } + }, + "GEOM/STB_CURVE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Curve", + "tooltip": "Create a curve" + }, + "fr": { + "name": "Courbe", + "tooltip": "Créer une courbe" + }, + "ja": { + "name": "曲線", + "tooltip": "カーブを作成" + } + } + }, + "GEOM/STB_CURVE_CREATOR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "2D Polyline", + "tooltip": "Create 2D polyline" + }, + "fr": { + "name": "Créateur de courbe", + "tooltip": "Créer une courbe" + }, + "ja": { + "name": "カーブの作成", + "tooltip": "2Dポリラインの作成" + } + } + }, + "GEOM/STB_CUT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Cut", + "tooltip": "Cut" + }, + "fr": { + "name": "Découpe", + "tooltip": "Découpe" + }, + "ja": { + "name": "カット(&t)", + "tooltip": "Cut" + } + } + }, + "GEOM/STB_CYLINDER": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Cylinder", + "tooltip": "Create a cylinder" + }, + "fr": { + "name": "Cylindre", + "tooltip": "Créer un cylindre" + }, + "ja": { + "name": "円筒", + "tooltip": "円柱を作成" + } + } + }, + "GEOM/STB_DELETE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Delete", + "tooltip": "Delete object" + }, + "fr": { + "name": "Supprimer", + "tooltip": "Supprimer un objet" + }, + "ja": { + "name": "削除", + "tooltip": "オブジェクトを削除" + } + } + }, + "GEOM/STB_DELETE_ANNOTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Delete", + "tooltip": "Delete Annotation" + }, + "fr": { + "name": "Supprimer", + "tooltip": "Supprimer l'annotation" + }, + "ja": { + "name": "削除", + "tooltip": "注記の削除" + } + } + }, + "GEOM/STB_DISK": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Disk", + "tooltip": "Create a disk" + }, + "fr": { + "name": "Disque", + "tooltip": "Créer un disque" + }, + "ja": { + "name": "円盤", + "tooltip": "円盤を作成" + } + } + }, + "GEOM/STB_DISPLAY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show", + "tooltip": "Show object(s)" + }, + "fr": { + "name": "Afficher", + "tooltip": "Afficher les objets" + }, + "ja": { + "name": "表示", + "tooltip": "表示オブジェクト" + } + } + }, + "GEOM/STB_DISPLAY_ALL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show All", + "tooltip": "Show all" + }, + "fr": { + "name": "Afficher tout", + "tooltip": "Afficher tout" + }, + "ja": { + "name": "全表示", + "tooltip": "すべてを表示" + } + } + }, + "GEOM/STB_DISPLAY_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show Only", + "tooltip": "Show only" + }, + "fr": { + "name": "Afficher uniquement", + "tooltip": "Afficher uniquement" + }, + "ja": { + "name": "選択のみ表示", + "tooltip": "選択のみ表示" + } + } + }, + "GEOM/STB_EDGE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edge", + "tooltip": "Build an edge" + }, + "fr": { + "name": "Arête", + "tooltip": "Créer une arête" + }, + "ja": { + "name": "エッジ", + "tooltip": "エッジを作成" + } + } + }, + "GEOM/STB_EDGE_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edge", + "tooltip": "Select only a Edges" + }, + "fr": { + "name": "Arête", + "tooltip": "Ne choisir que des arêtes" + }, + "ja": { + "name": "エッジ", + "tooltip": "エッジだけを選択" + } + } + }, + "GEOM/STB_EDGE_WIDTH": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edge Width", + "tooltip": "Edge Width" + }, + "fr": { + "name": "Epaisseur d'arête", + "tooltip": "Epaisseur d'arête" + }, + "ja": { + "name": "エッジの幅", + "tooltip": "エッジの幅" + } + } + }, + "GEOM/STB_EDIT_ANNOTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edit", + "tooltip": "Edit Annotation" + }, + "fr": { + "name": "Editer", + "tooltip": "Editer une annotation" + }, + "ja": { + "name": "編集", + "tooltip": "注記の編集" + } + } + }, + "GEOM/STB_ELLIPSE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Ellipse", + "tooltip": "Create an ellipse" + }, + "fr": { + "name": "Ellipse", + "tooltip": "Créer un ellipse" + }, + "ja": { + "name": "楕円", + "tooltip": "楕円を作成" + } + } + }, + "GEOM/STB_ERASE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Hide", + "tooltip": "Hide object(s)" + }, + "fr": { + "name": "Cacher", + "tooltip": "Cacher le(s) objet(s)" + }, + "ja": { + "name": "非表示", + "tooltip": "オブジェクトを非表示" + } + } + }, + "GEOM/STB_ERASE_ALL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Hide All", + "tooltip": "Hide all" + }, + "fr": { + "name": "Cacher tout", + "tooltip": "Cacher tout" + }, + "ja": { + "name": "すべてを非表示", + "tooltip": "すべてを非表示" + } + } + }, + "GEOM/STB_EXPLODE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Explode", + "tooltip": "Explode" + }, + "fr": { + "name": "Eclater", + "tooltip": "Eclater" + }, + "ja": { + "name": "展開", + "tooltip": "展開" + } + } + }, + "GEOM/STB_EXPLODE_BLOCKS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Explode on Blocks", + "tooltip": "Explode on Blocks" + }, + "fr": { + "name": "Eclater en blocs", + "tooltip": "Eclater en blocs" + }, + "ja": { + "name": "ブロックで展開", + "tooltip": "ブロックで展開" + } + } + }, + "GEOM/STB_EXTENSION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extension", + "tooltip": "Extend Edge or Face" + }, + "fr": { + "name": "Extension", + "tooltip": "Etend l'arête ou la face" + }, + "ja": { + "name": "拡張", + "tooltip": "エッジまたは面の拡張" + } + } + }, + "GEOM/STB_EXTRACTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extract and Rebuild", + "tooltip": "Extract and Rebuild" + }, + "fr": { + "name": "Extrait et reconstruit", + "tooltip": "Extrait et reconstruit" + }, + "ja": { + "name": "抽出と再構築", + "tooltip": "抽出と再構築" + } + } + }, + "GEOM/STB_EXTRUDED_BOSS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extruded boss", + "tooltip": "Extruded boss" + }, + "fr": { + "name": "Bossage extrudé", + "tooltip": "Bossage extrudé" + }, + "ja": { + "name": "押出し", + "tooltip": "押出し" + } + } + }, + "GEOM/STB_EXTRUDED_CUT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extruded cut", + "tooltip": "Extruded cut" + }, + "fr": { + "name": "Enlèvement de matière extrudé", + "tooltip": "Enlèvement de matière extrudé" + }, + "ja": { + "name": "押出しカット", + "tooltip": "押出成形材料の除去" + } + } + }, + "GEOM/STB_EXTRUSION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extrusion", + "tooltip": "Create an extrusion" + }, + "fr": { + "name": "Extrusion", + "tooltip": "Créer une extrusion" + }, + "ja": { + "name": "押出", + "tooltip": "押し出しを作成" + } + } + }, + "GEOM/STB_FACE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Face", + "tooltip": "Build a face" + }, + "fr": { + "name": "Face", + "tooltip": "Construire une face" + }, + "ja": { + "name": "面", + "tooltip": "フェースを作成" + } + } + }, + "GEOM/STB_FACE_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Face", + "tooltip": "Select only a Faces" + }, + "fr": { + "name": "Face", + "tooltip": "Ne choisir que des faces" + }, + "ja": { + "name": "面", + "tooltip": "フェースだけを選択" + } + } + }, + "GEOM/STB_FAST_CHECK_INTERSECTIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fast intersection", + "tooltip": "Fast intersection" + }, + "fr": { + "name": "Intersection rapide", + "tooltip": "Intersection rapide" + }, + "ja": { + "name": "クイック交点", + "tooltip": "クイック交点" + } + } + }, + "GEOM/STB_FEATURE_DETECTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shape recognition", + "tooltip": "Shape recognition" + }, + "fr": { + "name": "Reconnaissance de formes", + "tooltip": "Reconnaissance de formes" + }, + "ja": { + "name": "形状認識", + "tooltip": "パターン認識" + } + } + }, + "GEOM/STB_FIELD_CREATE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Create Field", + "tooltip": "Create a Field" + }, + "fr": { + "name": "Créer un champ", + "tooltip": "Créer un champ" + }, + "ja": { + "name": "フィールドの作成", + "tooltip": "フィールドを作成します。" + } + } + }, + "GEOM/STB_FIELD_EDIT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edit Field", + "tooltip": "Edit a Field" + }, + "fr": { + "name": "Editer un champ", + "tooltip": "Editer un champ" + }, + "ja": { + "name": "フィールドの編集", + "tooltip": "フィールドを編集します。" + } + } + }, + "GEOM/STB_FILLET": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fillet 3D", + "tooltip": "Create 3D fillet" + }, + "fr": { + "name": "Congé 3D", + "tooltip": "Créer un congé 3D" + }, + "ja": { + "name": "3Dフィレット", + "tooltip": "3Dフィレットを作成" + } + } + }, + "GEOM/STB_FILLET_1D": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fillet 1D", + "tooltip": "Create 1D fillet" + }, + "fr": { + "name": "Congé 1D", + "tooltip": "Créer un congé 1D" + }, + "ja": { + "name": "1D フィレット", + "tooltip": "1Dフィレットを作成" + } + } + }, + "GEOM/STB_FILLET_2D": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fillet 2D", + "tooltip": "Create 2D fillet" + }, + "fr": { + "name": "Congé 2D", + "tooltip": "Créer un congé 2D" + }, + "ja": { + "name": "2D フィレット", + "tooltip": "2Dフィレットを作成" + } + } + }, + "GEOM/STB_FILLING": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Filling", + "tooltip": "Create a filling" + }, + "fr": { + "name": "Nappe", + "tooltip": "Créer une nappe" + }, + "ja": { + "name": "埋込み", + "tooltip": "埋込みを作成" + } + } + }, + "GEOM/STB_FUSE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fuse", + "tooltip": "Fuse" + }, + "fr": { + "name": "Union", + "tooltip": "Union" + }, + "ja": { + "name": "結合", + "tooltip": "結合" + } + } + }, + "GEOM/STB_FUSE_EDGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Fuse Collinear Edges within a Wire", + "tooltip": "Fuse collinear edges within a wire" + }, + "fr": { + "name": "Fusionner les arêtes collinéaires au sein d'un contour", + "tooltip": "Fusionner les arêtes collinéaires au sein d'un contour" + }, + "ja": { + "name": "アウトライン内で共線性のエッジをマージします。", + "tooltip": "アウトライン内で共線性のエッジをマージします。" + } + } + }, + "GEOM/STB_GET_NON_BLOCKS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Get Non Blocks", + "tooltip": "Get non blocks" + }, + "fr": { + "name": "Récupérer les solides non blocs", + "tooltip": "Récupérer les solides non-blocs" + }, + "ja": { + "name": "固体非ブロックを取得します。", + "tooltip": "純色のブロックを取得します。" + } + } + }, + "GEOM/STB_GET_SHAPES_ON_SHAPE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Get Shapes on Shape", + "tooltip": "Get shapes on shape" + }, + "fr": { + "name": "Trouver les éléments d'un objet", + "tooltip": "Trouve les éléments d'un objet" + }, + "ja": { + "name": "オブジェクトの要素を見つける", + "tooltip": "オブジェクトの要素を見つける" + } + } + }, + "GEOM/STB_GET_SHARED_SHAPES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Get Shared Shapes", + "tooltip": "Get shared shapes" + }, + "fr": { + "name": "Trouver les éléments partagés", + "tooltip": "Trouve les éléments partagés" + }, + "ja": { + "name": "共有アイテムを取得", + "tooltip": "共有アイテムを取得" + } + } + }, + "GEOM/STB_GLUE_EDGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Glue Edges", + "tooltip": "Perform glue edges" + }, + "fr": { + "name": "Recoller les arêtes", + "tooltip": "Recoller les arêtes" + }, + "ja": { + "name": "エッジの固着", + "tooltip": "エッジ固着" + } + } + }, + "GEOM/STB_GLUE_FACES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Glue Faces", + "tooltip": "Perform glue faces" + }, + "fr": { + "name": "Recoller les faces", + "tooltip": "Recoller les faces" + }, + "ja": { + "name": "面の固着", + "tooltip": "フェース固着" + } + } + }, + "GEOM/STB_GROUP_CREATE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Create Group", + "tooltip": "Create a group" + }, + "fr": { + "name": "Créer un groupe", + "tooltip": "Créer un groupe" + }, + "ja": { + "name": "グループを作成", + "tooltip": "グループを作成" + } + } + }, + "GEOM/STB_GROUP_CUT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Cut Groups", + "tooltip": "Cut Groups" + }, + "fr": { + "name": "Découpe de groupes", + "tooltip": "Découpe de groupes" + }, + "ja": { + "name": "グループのカット", + "tooltip": "切断グループ" + } + } + }, + "GEOM/STB_GROUP_EDIT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edit Group", + "tooltip": "Edit a group" + }, + "fr": { + "name": "Editer", + "tooltip": "Editer un groupe" + }, + "ja": { + "name": "グループの編集", + "tooltip": "グループを編集" + } + } + }, + "GEOM/STB_GROUP_INTERSECT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Intersect Groups", + "tooltip": "Intersect Groups" + }, + "fr": { + "name": "Intersection de groupes", + "tooltip": "Intersection de groupes" + }, + "ja": { + "name": "グループの交差", + "tooltip": "グループの共有領域" + } + } + }, + "GEOM/STB_GROUP_UNION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Union Groups", + "tooltip": "Union Groups" + }, + "fr": { + "name": "Union de groupes", + "tooltip": "Union de groupes" + }, + "ja": { + "name": "グループの結合", + "tooltip": "グループの連合" + } + } + }, + "GEOM/STB_HEX_SOLID": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Hexahedral Solid", + "tooltip": "Hexahedral Solid" + }, + "fr": { + "name": "Solide hexaédrique", + "tooltip": "Solide hexaédrique" + }, + "ja": { + "name": "六面体ソリッド", + "tooltip": "Hexahedral_Solid" + } + } + }, + "GEOM/STB_INERTIA": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Inertia", + "tooltip": "Compute moments of intertia of the shape" + }, + "fr": { + "name": "Inertie", + "tooltip": "Calculer les moments d'inertie de l'objet" + }, + "ja": { + "name": "慣性", + "tooltip": "オブジェクトの慣性モーメントを計算します。" + } + } + }, + "GEOM/STB_INSPECT_OBJECT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Inspect Object", + "tooltip": "Inspect Object" + }, + "fr": { + "name": "Inspecter un objet", + "tooltip": "Inspecter un objet" + }, + "ja": { + "name": "オブジェクトの点検", + "tooltip": "オブジェクトの点検" + } + } + }, + "GEOM/STB_ISOLINE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Isoline", + "tooltip": "Create U- or V-Isoline" + }, + "fr": { + "name": "Isoligne", + "tooltip": "Créer une U ou V isoligne" + }, + "ja": { + "name": "等高線", + "tooltip": "UまたはV方向等高線の作成" + } + } + }, + "GEOM/STB_ISOS_WIDTH": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Isos Width", + "tooltip": "Isos Width" + }, + "fr": { + "name": "Epaisseur des isos", + "tooltip": "Epaisseur des isos" + }, + "ja": { + "name": "Iso イメージの幅", + "tooltip": "Iso イメージの幅" + } + } + }, + "GEOM/STB_LIMIT_TOLERANCE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Limit tolerance", + "tooltip": "Limit tolerance" + }, + "fr": { + "name": "Tolérance limite", + "tooltip": "Tolérance limite" + }, + "ja": { + "name": "許容範囲", + "tooltip": "許容範囲" + } + } + }, + "GEOM/STB_LINE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Line", + "tooltip": "Create a line" + }, + "fr": { + "name": "Ligne", + "tooltip": "Créer une ligne" + }, + "ja": { + "name": "線", + "tooltip": "ラインを作成" + } + } + }, + "GEOM/STB_LOCAL_CS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Local Coordinate System", + "tooltip": "Create a local coordinate system" + }, + "fr": { + "name": "Système de coordonnées local ", + "tooltip": "Créer un système local de coordonnées" + }, + "ja": { + "name": "ローカル座標系", + "tooltip": "ローカル座標系を作成" + } + } + }, + "GEOM/STB_MANAGE_DIMENSIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Manage dimensions", + "tooltip": "Manage measurement dimensions of an object" + }, + "fr": { + "name": "Gérer les cotations", + "tooltip": "Gérer la cotation d'un objet" + }, + "ja": { + "name": "ディメンジョンの管理", + "tooltip": "オブジェクトの基準寸法を管理" + } + } + }, + "GEOM/STB_MASS_CENTER": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Center of Mass", + "tooltip": "Compute center of mass of the shape" + }, + "fr": { + "name": "Centre de gravité", + "tooltip": "Calculer le centre de gravité de l'objet" + }, + "ja": { + "name": "重心", + "tooltip": "オブジェクトの重心を計算" + } + } + }, + "GEOM/STB_MATERIALS_LIBRARY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Materials library", + "tooltip": "Displays content of Materials library" + }, + "fr": { + "name": "Librairie de materiaux", + "tooltip": "Affichier le contenu de la librarie des matériaux" + }, + "ja": { + "name": "材料ライブラリ", + "tooltip": "材料のライブラリの内容を表示します。" + } + } + }, + "GEOM/STB_MEASURE_ANGLE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Angle", + "tooltip": "Compute angle between two lines or linear edges" + }, + "fr": { + "name": "Angle", + "tooltip": "Calculer l'angle entre deux lignes ou arêtes linéaires" + }, + "ja": { + "name": "角度", + "tooltip": "2つのラインまたはエッジ間の角度を計算" + } + } + }, + "GEOM/STB_MIN_DIST": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Min Distance", + "tooltip": "Compute minimum distance between two objects" + }, + "fr": { + "name": "Distance minimale ", + "tooltip": "Calculer la distance minimale entre deux objets" + }, + "ja": { + "name": "最短距離", + "tooltip": "2つのオブジェクト間の最小距離を計算" + } + } + }, + "GEOM/STB_MIRROR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Mirror Image", + "tooltip": "Mirror a shape" + }, + "fr": { + "name": "Symétrie", + "tooltip": "Refléter un objet" + }, + "ja": { + "name": "ミラー", + "tooltip": "オブジェクトを反転" + } + } + }, + "GEOM/STB_MODIFY_LOCATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Modify Location", + "tooltip": "Modify shape's location" + }, + "fr": { + "name": "Modifier la position", + "tooltip": "Modifier la position d'un objet" + }, + "ja": { + "name": "位置変更", + "tooltip": "オブジェクトの位置を変更" + } + } + }, + "GEOM/STB_MUL_ROTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Multi-Rotation", + "tooltip": "Perform multi-rotation" + }, + "fr": { + "name": "Multi-rotation", + "tooltip": "Effectuer une multi-rotation" + }, + "ja": { + "name": "複数回回転", + "tooltip": "複数回回転を実行します。" + } + } + }, + "GEOM/STB_MUL_TRANSFORM": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Multi-Transformation", + "tooltip": "Perform multi-transformation" + }, + "fr": { + "name": "Multi-transformation", + "tooltip": "Effectuer une multi-transformation" + }, + "ja": { + "name": "複数回移動", + "tooltip": "複数回移動を実行します。" + } + } + }, + "GEOM/STB_MUL_TRANSLATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Multi-Translation", + "tooltip": "Perform multi-translation" + }, + "fr": { + "name": "Multi-translation", + "tooltip": "Effectuer une multi-translation" + }, + "ja": { + "name": "複数オブジェクトの移動", + "tooltip": "複数オブジェクトの移動を実行" + } + } + }, + "GEOM/STB_NAME_MODE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show/Hide names of visible shapes", + "tooltip": "Show/Hide names of visible shapes" + }, + "fr": { + "name": "Montrer/cacher le nom des objets visibles", + "tooltip": "Montrer/cacher le nom des objets visibles" + }, + "ja": { + "name": "表示中の形状の名前を表示/非表示", + "tooltip": "表示中の形状の名前を表示/非表示" + } + } + }, + "GEOM/STB_NORMALE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Normal to a Face", + "tooltip": "Compute normal to the face" + }, + "fr": { + "name": "Vecteur normal à une face", + "tooltip": "Vecteur normal à une face" + }, + "ja": { + "name": "フェースに垂直", + "tooltip": "フェースに垂直" + } + } + }, + "GEOM/STB_OFFSET": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Offset Surface", + "tooltip": "Offset surface" + }, + "fr": { + "name": "Décaler une surface", + "tooltip": "Décaler une surface " + }, + "ja": { + "name": "サーフェスをオフセット", + "tooltip": "サーフェスをオフセット" + } + } + }, + "GEOM/STB_ORIGIN_AND_VECTORS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Origin and Base Vectors", + "tooltip": "Create an origin and base Vectors" + }, + "fr": { + "name": "Vecteurs de base et origine", + "tooltip": "Créer les vecteurs de base et l'origine" + }, + "ja": { + "name": "起源と基本ベクトル", + "tooltip": "起源と基底ベクトルを作成します。" + } + } + }, + "GEOM/STB_PARTITION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Partition", + "tooltip": "Make a partition" + }, + "fr": { + "name": "Partition", + "tooltip": "Effectuer une partition" + }, + "ja": { + "name": "パーティション", + "tooltip": "パーティションを作成" + } + } + }, + "GEOM/STB_PICTURE_IMPORT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import picture in viewer", + "tooltip": "Import picture in viewer" + }, + "fr": { + "name": "Importer une image dans la vue", + "tooltip": "Importer une image dans la vue" + }, + "ja": { + "name": "ビューアーにイメージをインポート", + "tooltip": "ビューアーにイメージをインポートします。" + } + } + }, + "GEOM/STB_PIPE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Extrusion Along Path", + "tooltip": "Create a shape by extrusion along a path" + }, + "fr": { + "name": "Extrusion suivant un chemin", + "tooltip": "Créer un objet par extrusion suivant un chemin" + }, + "ja": { + "name": "経路に沿って押し出し", + "tooltip": "経路に沿って押し出し" + } + } + }, + "GEOM/STB_PIPE_PATH": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Restore Path", + "tooltip": "Restore path from a pipe-like shape" + }, + "fr": { + "name": "Retrouver le chemin", + "tooltip": "Retrouver le chemin à partir d'un objet de type tuyau" + }, + "ja": { + "name": "経路の復元", + "tooltip": "経路の復元" + } + } + }, + "GEOM/STB_PLANE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Plane", + "tooltip": "Create a plane" + }, + "fr": { + "name": "Plan", + "tooltip": "Créer un plan" + }, + "ja": { + "name": "平面", + "tooltip": "平面を作成" + } + } + }, + "GEOM/STB_POINT": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Point", + "tooltip": "Create a point" + }, + "fr": { + "name": "Point", + "tooltip": "Créer un point" + }, + "ja": { + "name": "点", + "tooltip": "ポイントを作成" + } + } + }, + "GEOM/STB_POINT_COORDS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Point Coordinates", + "tooltip": "Display point coordinates" + }, + "fr": { + "name": "Coordonnées d'un point ", + "tooltip": "Montrer les coordonnées du point" + }, + "ja": { + "name": "点の座標", + "tooltip": "ポイントの座標を表示" + } + } + }, + "GEOM/STB_POINT_ON_EDGE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Add Point on Edge", + "tooltip": "Add point on edge" + }, + "fr": { + "name": "Ajouter un point sur l'arête", + "tooltip": "Ajouter un point sur l'arête" + }, + "ja": { + "name": "エッジに点を追加", + "tooltip": "端にポイントを追加" + } + } + }, + "GEOM/STB_POP_AUTO_COLOR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Auto Color", + "tooltip": "Auto color" + }, + "fr": { + "name": "Couleur automatique", + "tooltip": "Couleur automatique" + }, + "ja": { + "name": "自動色", + "tooltip": "自動色" + } + } + }, + "GEOM/STB_POP_COLOR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Color", + "tooltip": "Color" + }, + "fr": { + "name": "Couleur", + "tooltip": "Couleur" + }, + "ja": { + "name": "色", + "tooltip": "色" + } + } + }, + "GEOM/STB_POP_CONCEAL_CHILDREN": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Conceal child items", + "tooltip": "Conceal child items" + }, + "fr": { + "name": "Retirer les sous-éléments", + "tooltip": "Cacher les objets fils" + }, + "ja": { + "name": "子項目を隠す", + "tooltip": "子供オブジェクトを隠す" + } + } + }, + "GEOM/STB_POP_CREATE_FOLDER": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Create folder", + "tooltip": "Create a new folder" + }, + "fr": { + "name": "Créer dossier", + "tooltip": "Créer un nouveau dossier" + }, + "ja": { + "name": "フォルダ作成", + "tooltip": "新しいフォルダーを作成します。" + } + } + }, + "GEOM/STB_POP_CREATE_GROUP": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Create Group", + "tooltip": "Create Group" + }, + "fr": { + "name": "Créer un groupe", + "tooltip": "Créer un groupe" + }, + "ja": { + "name": "グループを作成", + "tooltip": "グループを作成" + } + } + }, + "GEOM/STB_POP_DEFLECTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Deflection Coefficient", + "tooltip": "Deflection Coefficient" + }, + "fr": { + "name": "Coefficient de déformation", + "tooltip": "Coefficient de déformation" + }, + "ja": { + "name": "変形倍率", + "tooltip": "変形倍率" + } + } + }, + "GEOM/STB_POP_DISABLE_AUTO_COLOR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Disable Auto Color", + "tooltip": "Disable auto color" + }, + "fr": { + "name": "Désactiver la couleur automatique", + "tooltip": "Désactiver la couleur automatique" + }, + "ja": { + "name": "自動色無効", + "tooltip": "自動カラー補正を無効にします。" + } + } + }, + "GEOM/STB_POP_DISCLOSE_CHILDREN": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Disclose child items", + "tooltip": "Disclose child items" + }, + "fr": { + "name": "Publier les sous-éléments", + "tooltip": "Afficher les objets fils" + }, + "ja": { + "name": "子項目を開示", + "tooltip": "子供を表示します。" + } + } + }, + "GEOM/STB_POP_EDIT_FIELD": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Edit Field", + "tooltip": "Edit Field" + }, + "fr": { + "name": "Editer champ", + "tooltip": "Editer un champ" + }, + "ja": { + "name": "フィールドの編集", + "tooltip": "フィールドを編集します。" + } + } + }, + "GEOM/STB_POP_HIDE_ALL_ANNOTATIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Hide all annotations", + "tooltip": "Hide all shape annotations for the object" + }, + "fr": { + "name": "Cacher toutes les annotations", + "tooltip": "Cacher toutes les annotations pour l'objet" + }, + "ja": { + "name": "全ての注釈を非表示", + "tooltip": "対象オブジェクトにある全ての形状注釈の非表示" + } + } + }, + "GEOM/STB_POP_HIDE_ALL_DIMENSIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Hide all dimensions", + "tooltip": "Show all visible measures (dimension) created for the object" + }, + "fr": { + "name": "Cacher toutes les cotations", + "tooltip": "Afficher toutes les cotations visibles créées sur l'objet" + }, + "ja": { + "name": "すべての寸法を非表示", + "tooltip": "オブジェクトのために作成されたすべての見える基準寸法を表示" + } + } + }, + "GEOM/STB_POP_ISOS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Isos", + "tooltip": "Isolines" + }, + "fr": { + "name": "Isos", + "tooltip": "Isolignes" + }, + "ja": { + "name": "Isos", + "tooltip": "輪郭" + } + } + }, + "GEOM/STB_POP_MATERIAL_PROPERTIES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Material Properties", + "tooltip": "Set Material Properties" + }, + "fr": { + "name": "Propriétés des matériaux", + "tooltip": "Définir les propriétés du matériau" + }, + "ja": { + "name": "材料特性", + "tooltip": "マテリアルのプロパティを設定します。" + } + } + }, + "GEOM/STB_POP_POINT_MARKER": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Point Marker", + "tooltip": "Set Point Marker" + }, + "fr": { + "name": "Marqueur de point", + "tooltip": "Définir un marqueur de point" + }, + "ja": { + "name": "ポイント マーカ", + "tooltip": "ポイントマーカーを設定" + } + } + }, + "GEOM/STB_POP_PREDEF_MATER_CUSTOM": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Custom...", + "tooltip": "Custom..." + }, + "fr": { + "name": "Personnalisé...", + "tooltip": "Personnalisé..." + }, + "ja": { + "name": "カスタム...", + "tooltip": "カスタム." + } + } + }, + "GEOM/STB_POP_PUBLISH_OBJ": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Publish...", + "tooltip": "Publish object" + }, + "fr": { + "name": "Publier...", + "tooltip": "Publier l'objet" + }, + "ja": { + "name": "発行...", + "tooltip": "オブジェクトを発行" + } + } + }, + "GEOM/STB_POP_REDUCE_STUDY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Reduce study", + "tooltip": "Reduce study" + }, + "fr": { + "name": "Etude réduite", + "tooltip": "Etude réduite" + }, + "ja": { + "name": "スタディの削減", + "tooltip": "スタディの縮小" + } + } + }, + "GEOM/STB_POP_SETTEXTURE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Texture", + "tooltip": "Add a texture" + }, + "fr": { + "name": "Texture", + "tooltip": "Ajoute une texture" + }, + "ja": { + "name": "テクスチャ", + "tooltip": "テクスチャを追加します。" + } + } + }, + "GEOM/STB_POP_SHADING": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shading", + "tooltip": "Shading" + }, + "fr": { + "name": "Ombrage", + "tooltip": "Ombrage" + }, + "ja": { + "name": "シェーディング", + "tooltip": "網かけ" + } + } + }, + "GEOM/STB_POP_SHADING_WITH_EDGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shading With Edges", + "tooltip": "Shading With Edges" + }, + "fr": { + "name": "Ombrage avec arêtes", + "tooltip": "Ombrage avec arêtes" + }, + "ja": { + "name": "エッジ+シェーディング", + "tooltip": "陰影とエッジ" + } + } + }, + "GEOM/STB_POP_SHOW_ALL_ANNOTATIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show all annotations", + "tooltip": "Show all shape annotations for the object" + }, + "fr": { + "name": "Montrer toutes les annotations", + "tooltip": "Montrer toutes les annotations pour l'objet" + }, + "ja": { + "name": "全ての注釈を表示", + "tooltip": "対象オブジェクトにある全ての形状注釈を表示" + } + } + }, + "GEOM/STB_POP_SHOW_ALL_DIMENSIONS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show all dimensions", + "tooltip": "Show all hidden measures (dimension) created for the object" + }, + "fr": { + "name": "Afficher les cotations ", + "tooltip": "Afficher toutes les cotations cachées pour un objet" + }, + "ja": { + "name": "すべての寸法を表示", + "tooltip": "オブジェクトに作成されたすべての非表示の基準寸法を表示" + } + } + }, + "GEOM/STB_POP_SHOW_DEPENDENCY_TREE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show dependency tree", + "tooltip": "Show dependency tree" + }, + "fr": { + "name": "Montrer l'arbre des dépendances", + "tooltip": "Montrer l'arbre des dépendances" + }, + "ja": { + "name": "依存ツリーの表示", + "tooltip": "依存ツリーの表示" + } + } + }, + "GEOM/STB_POP_SHOW_NAME": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show Name", + "tooltip": "Show Name" + }, + "fr": { + "name": "Montrer le nom", + "tooltip": "Montrer le nom" + }, + "ja": { + "name": "名前の表示", + "tooltip": "名前の表示" + } + } + }, + "GEOM/STB_POP_SORT_CHILD_ITEMS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Sort children", + "tooltip": "Sort child items" + }, + "fr": { + "name": "Trier les descendants", + "tooltip": "Trier les descendants" + }, + "ja": { + "name": "子供の並べ替え", + "tooltip": "子アイテムを並べ替える" + } + } + }, + "GEOM/STB_POP_TEXTURE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Texture", + "tooltip": "Texture" + }, + "fr": { + "name": "Texture", + "tooltip": "Texture" + }, + "ja": { + "name": "テクスチャ", + "tooltip": "テクスチャ" + } + } + }, + "GEOM/STB_POP_TRANSPARENCY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Transparency", + "tooltip": "Transparency" + }, + "fr": { + "name": "Transparence", + "tooltip": "Transparence" + }, + "ja": { + "name": "透明度", + "tooltip": "透明度" + } + } + }, + "GEOM/STB_POP_UNPUBLISH_OBJ": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Unpublish", + "tooltip": "Unpublish object" + }, + "fr": { + "name": "Dépublier", + "tooltip": "Dépublier l'objet" + }, + "ja": { + "name": "発行停止", + "tooltip": "オブジェクトの発行停止" + } + } + }, + "GEOM/STB_POP_VECTORS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show Edge Direction", + "tooltip": "Show Edge Direction" + }, + "fr": { + "name": "Afficher l'orientation des arêtes", + "tooltip": "Afficher l'orientation des arêtes" + }, + "ja": { + "name": "ベクトル方向表示", + "tooltip": "エッジの方向を表示します。" + } + } + }, + "GEOM/STB_POP_VERTICES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show Vertices", + "tooltip": "Show Vertices" + }, + "fr": { + "name": "Montrer les sommets", + "tooltip": "Montrer les sommets" + }, + "ja": { + "name": "頂点の表示", + "tooltip": "頂点の表示" + } + } + }, + "GEOM/STB_POP_WIREFRAME": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Wireframe", + "tooltip": "Wireframe" + }, + "fr": { + "name": "Filaire", + "tooltip": "Contours" + }, + "ja": { + "name": "ワイヤ フレーム", + "tooltip": "Wires" + } + } + }, + "GEOM/STB_PROJECTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Projection", + "tooltip": "Project a point, an edge or a wire on a face" + }, + "fr": { + "name": "Projection", + "tooltip": "Projeter un point, une arête ou un contour sur une face" + }, + "ja": { + "name": "投影", + "tooltip": "ポイント、エッジ、または輪郭上の 1 つの側面を投影" + } + } + }, + "GEOM/STB_PROJ_ON_CYL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Projection on Cylinder", + "tooltip": "Project a wire or a face on a cylinder" + }, + "fr": { + "name": "Projection sur un cylindre", + "tooltip": "Projète un contour ou une face sur un cylindre" + }, + "ja": { + "name": "円筒の投影", + "tooltip": "円筒上のワイヤまたは面を投影" + } + } + }, + "GEOM/STB_PROPAGATE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Propagate", + "tooltip": "Propagate" + }, + "fr": { + "name": "Propager", + "tooltip": "Propager" + }, + "ja": { + "name": "スプレッド", + "tooltip": "スプレッド" + } + } + }, + "GEOM/STB_Q_FACE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Quadrangle Face", + "tooltip": "Quadrangle Face" + }, + "fr": { + "name": "Face quadrangulaire ", + "tooltip": "Face quadrangulaire " + }, + "ja": { + "name": "四角形フェース", + "tooltip": "四角形フェース" + } + } + }, + "GEOM/STB_RECTANGLE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Rectangle", + "tooltip": "Create rectangular face" + }, + "fr": { + "name": "Rectangle", + "tooltip": "Créer une face rectangulaire " + }, + "ja": { + "name": "四角形", + "tooltip": "長方形の面を作成" + } + } + }, + "GEOM/STB_RELOAD_IMPORTED": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Reload From Disk", + "tooltip": "Reload imported shape from its original place on disk" + }, + "fr": { + "name": "Recharger à partir du disque", + "tooltip": "Recharger l'objet importé depuis le disque" + }, + "ja": { + "name": "ディスクから再読み込み", + "tooltip": "ディスク上の元の場所からインポートした形状をリロード" + } + } + }, + "GEOM/STB_REMOVE_EXTRA_EDGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Remove Extra Edges", + "tooltip": "Remove extra edges" + }, + "fr": { + "name": "Supprimer les arêtes inutiles", + "tooltip": "Supprimer les arêtes inutiles" + }, + "ja": { + "name": "不要なエッジを削除", + "tooltip": "不要なエッジを削除" + } + } + }, + "GEOM/STB_REMOVE_WEBS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Remove Internal Faces", + "tooltip": "Remove internal faces" + }, + "fr": { + "name": "Supprimer les faces internes", + "tooltip": "Supprimer les faces internes" + }, + "ja": { + "name": "内部面の削除", + "tooltip": "内部面を削除します。" + } + } + }, + "GEOM/STB_REVOLUTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Revolution", + "tooltip": "Create a revolution" + }, + "fr": { + "name": "Révolution", + "tooltip": "Créer une révolution" + }, + "ja": { + "name": "回転押し出し", + "tooltip": "回転押し出しの作成" + } + } + }, + "GEOM/STB_ROTATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Rotation", + "tooltip": "Rotate a shape" + }, + "fr": { + "name": "Rotation", + "tooltip": "Tourner un objet" + }, + "ja": { + "name": "回転", + "tooltip": "オブジェクトを回転" + } + } + }, + "GEOM/STB_SCALE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Scale Transform", + "tooltip": "Scale a shape" + }, + "fr": { + "name": "Redimensionner", + "tooltip": "Redimensionner un objet" + }, + "ja": { + "name": "サイズを変更", + "tooltip": "オブジェクトのサイズを変更" + } + } + }, + "GEOM/STB_SECTION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Intersection", + "tooltip": "Intersection" + }, + "fr": { + "name": "Section", + "tooltip": "Section" + }, + "ja": { + "name": "セクション", + "tooltip": "セクション" + } + } + }, + "GEOM/STB_SEWING": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Sewing", + "tooltip": "Perform sewing" + }, + "fr": { + "name": "Couture", + "tooltip": "Effectuer la couture" + }, + "ja": { + "name": "縫合", + "tooltip": "縫い合わせ実行" + } + } + }, + "GEOM/STB_SHADING": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shading", + "tooltip": "Shading" + }, + "fr": { + "name": "Ombrage", + "tooltip": "Ombrage" + }, + "ja": { + "name": "網かけ", + "tooltip": "網かけ" + } + } + }, + "GEOM/STB_SHADING_WITH_EDGES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shading With Edges", + "tooltip": "Shading with edges" + }, + "fr": { + "name": "Ombrage avec arêtes", + "tooltip": "Ombrage avec arêtes" + }, + "ja": { + "name": "陰影とエッジ", + "tooltip": "陰影とエッジ" + } + } + }, + "GEOM/STB_SHAPE_PROCESS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shape Processing", + "tooltip": "Perform shape processing " + }, + "fr": { + "name": "Traitement de forme", + "tooltip": "Effectuer le traitement de formes" + }, + "ja": { + "name": "形状処理", + "tooltip": "形状処理を実行する" + } + } + }, + "GEOM/STB_SHAPE_STATISTICS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shape Statistics", + "tooltip": "Shape Statistics" + }, + "fr": { + "name": "Statistiques sur l'objet", + "tooltip": "Statistique de l'objet" + }, + "ja": { + "name": "形状の統計", + "tooltip": "形状の統計" + } + } + }, + "GEOM/STB_SHELL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shell", + "tooltip": "Build a shell" + }, + "fr": { + "name": "Coque", + "tooltip": "Construire une coque" + }, + "ja": { + "name": "シェル", + "tooltip": "シェルを構築" + } + } + }, + "GEOM/STB_SHELL_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Shell", + "tooltip": "Select only a Shells" + }, + "fr": { + "name": "Coque", + "tooltip": "Ne choisir que des coques" + }, + "ja": { + "name": "シェル", + "tooltip": "シェルのみを選択" + } + } + }, + "GEOM/STB_SHOW_ONLY_CHILDREN": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Show Only Children", + "tooltip": "Show Only Children" + }, + "fr": { + "name": "Afficher uniquement les enfants", + "tooltip": "Afficher uniquement les enfants" + }, + "ja": { + "name": "子供だけを表示します。", + "tooltip": "子供だけを表示します。" + } + } + }, + "GEOM/STB_SKETCH": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "2D Sketch", + "tooltip": "Create 2D sketch" + }, + "fr": { + "name": "Esquisse 2D", + "tooltip": "Créer une esquisse 2D" + }, + "ja": { + "name": "2D スケッチ", + "tooltip": "2Dスケッチを作成" + } + } + }, + "GEOM/STB_SOLID": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Solid", + "tooltip": "Build a solid" + }, + "fr": { + "name": "Solide", + "tooltip": "Construire un solide" + }, + "ja": { + "name": "ソリッド", + "tooltip": "ソリッドを構築" + } + } + }, + "GEOM/STB_SOLID_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Solid", + "tooltip": "Select only a Solids" + }, + "fr": { + "name": "Solide", + "tooltip": "Ne choisir que des solides" + }, + "ja": { + "name": "ソリッド", + "tooltip": "ソリッドだけを選択" + } + } + }, + "GEOM/STB_SPHERE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Sphere", + "tooltip": "Create a sphere" + }, + "fr": { + "name": "Sphère", + "tooltip": "Créer une sphère" + }, + "ja": { + "name": "球", + "tooltip": "球を作成" + } + } + }, + "GEOM/STB_SUPPERSS_HOLES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Suppress Holes", + "tooltip": "Perform suppress holes" + }, + "fr": { + "name": "Supprimer les trous", + "tooltip": "Effectuer la suppression des trous" + }, + "ja": { + "name": "穴を削除", + "tooltip": "穴の削除を実行" + } + } + }, + "GEOM/STB_SUPPRESS_FACES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Suppress Faces", + "tooltip": "Perform suppress faces" + }, + "fr": { + "name": "Supprimer des faces", + "tooltip": "Effectuer la suppression des faces" + }, + "ja": { + "name": "フェースを削除", + "tooltip": "フェースの削除を実行" + } + } + }, + "GEOM/STB_SUPPRESS_INT_WIRES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Suppress Internal Wires", + "tooltip": "Perform suppress internal wires" + }, + "fr": { + "name": "Supprimer des contours internes", + "tooltip": "Effectuer la suppression des contours internes" + }, + "ja": { + "name": "内部の輪郭を削除します。", + "tooltip": "内部ワイヤーの削除を実行" + } + } + }, + "GEOM/STB_SURFACE_FROM_FACE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Surface From Face", + "tooltip": "Create a Surface From Face" + }, + "fr": { + "name": "Surface depuis une face", + "tooltip": "Créer une surface depuis une face" + }, + "ja": { + "name": "面から表面", + "tooltip": "面から表面の作成" + } + } + }, + "GEOM/STB_TEXTURE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Texture", + "tooltip": "Texture" + }, + "fr": { + "name": "Texture", + "tooltip": "Texture" + }, + "ja": { + "name": "テクスチャ", + "tooltip": "テクスチャ" + } + } + }, + "GEOM/STB_THICKNESS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Thickness", + "tooltip": "Make a thick solid" + }, + "fr": { + "name": "Epaisseur", + "tooltip": "Crée un solide par ajout d'épaisseur" + }, + "ja": { + "name": "厚み", + "tooltip": "厚みのあるソリッドの作成" + } + } + }, + "GEOM/STB_TOLERANCE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Tolerance", + "tooltip": "Compute tolerance of the shape" + }, + "fr": { + "name": "Tolérance", + "tooltip": "Calculer la tolérance d'un objet" + }, + "ja": { + "name": "公差", + "tooltip": "オブジェクトの距離を計算" + } + } + }, + "GEOM/STB_TORUS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Torus", + "tooltip": "Create a torus" + }, + "fr": { + "name": "Tore", + "tooltip": "Créer un tore" + }, + "ja": { + "name": "円環", + "tooltip": "円環を作成" + } + } + }, + "GEOM/STB_TRANSFER_DATA": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Transfer Data", + "tooltip": "Transfer Data" + }, + "fr": { + "name": "Transfert de données", + "tooltip": "Transfert de données" + }, + "ja": { + "name": "データ転送", + "tooltip": "データ転送" + } + } + }, + "GEOM/STB_TRANSLATION": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Translation", + "tooltip": "Translate shape" + }, + "fr": { + "name": "Translation", + "tooltip": "Translater un objet" + }, + "ja": { + "name": "変換", + "tooltip": "オブジェクトを移動" + } + } + }, + "GEOM/STB_UNION_FACES": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Union Faces", + "tooltip": "Union faces" + }, + "fr": { + "name": "Unir les Faces", + "tooltip": "Unir les faces" + }, + "ja": { + "name": "面の共有", + "tooltip": "連合に直面しています。" + } + } + }, + "GEOM/STB_VECTOR": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Vector", + "tooltip": "Create a vector" + }, + "fr": { + "name": "Vecteur", + "tooltip": "Créer un vecteur" + }, + "ja": { + "name": "ベクトル", + "tooltip": "ベクトルを作成" + } + } + }, + "GEOM/STB_VECTOR_MODE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Change Edge Presentation Mode", + "tooltip": "Change Edge Presentation Mode" + }, + "fr": { + "name": "Changer le mode de représentation des arêtes", + "tooltip": "Changer le mode de représentation des arêtes" + }, + "ja": { + "name": "エッジの表示モードを変更", + "tooltip": "エッジの表示モードを変更" + } + } + }, + "GEOM/STB_VERTEX_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Vertex", + "tooltip": "Select only a Points" + }, + "fr": { + "name": "Point", + "tooltip": "Ne choisir que des points" + }, + "ja": { + "name": "基準点", + "tooltip": "ポイントのみを選択" + } + } + }, + "GEOM/STB_VERTICES_MODE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Mode of vertices", + "tooltip": "Mode of vertices" + }, + "fr": { + "name": "Mode des sommets", + "tooltip": "Mode des sommets" + }, + "ja": { + "name": "頂点のモード", + "tooltip": "頂点のモード" + } + } + }, + "GEOM/STB_WHAT_IS": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "What is", + "tooltip": "What is" + }, + "fr": { + "name": "Qu'est-ce que c'est ?", + "tooltip": "Qu'est-ce que c'est ?" + }, + "ja": { + "name": "選択対象の情報", + "tooltip": "Whatis" + } + } + }, + "GEOM/STB_WIRE": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Wire", + "tooltip": "Build a wire" + }, + "fr": { + "name": "Contour", + "tooltip": "Construire un contour" + }, + "ja": { + "name": "ワイヤー", + "tooltip": "ワイヤーを構築" + } + } + }, + "GEOM/STB_WIREFRAME": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Wireframe", + "tooltip": "Wireframe" + }, + "fr": { + "name": "Filaire", + "tooltip": "Contours" + }, + "ja": { + "name": "ワイヤ フレーム", + "tooltip": "Wires" + } + } + }, + "GEOM/STB_WIRE_SEL_ONLY": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Wire", + "tooltip": "Select only a Wires" + }, + "fr": { + "name": "Contour", + "tooltip": "Ne choisir que des contours" + }, + "ja": { + "name": "ワイヤー", + "tooltip": "ワイヤーだけを選択" + } + } + }, + "GEOM/STEPPlugin/Export_STEP": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export STEP", + "tooltip": "Export STEP" + }, + "fr": { + "name": "Exporter STEP", + "tooltip": "Exporter STEP" + }, + "ja": { + "name": "STEPエクスポート", + "tooltip": "STEPエクスポート" + } + } + }, + "GEOM/STEPPlugin/Import_STEP": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import STEP", + "tooltip": "Import STEP" + }, + "fr": { + "name": "Importer STEP", + "tooltip": "Importer STEP" + }, + "ja": { + "name": "STEPインポート", + "tooltip": "STEPインポート" + } + } + }, + "GEOM/STLPlugin/Export_STL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export STL", + "tooltip": "Export STL" + }, + "fr": { + "name": "Exporter STL", + "tooltip": "Exporter STL" + }, + "ja": { + "name": "STLエクスポート", + "tooltip": "STLエクスポート" + } + } + }, + "GEOM/STLPlugin/Import_STL": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import STL", + "tooltip": "Import STL" + }, + "fr": { + "name": "Importer STL", + "tooltip": "Importer STL" + }, + "ja": { + "name": "STLインポート", + "tooltip": "STLインポート" + } + } + }, + "GEOM/Transparency/Decrease": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Decrease transparency", + "tooltip": "Decrease transparency" + }, + "fr": { + "name": "Diminuer la transparence", + "tooltip": "Diminuer la transparence" + }, + "ja": { + "name": "透明度を下げる", + "tooltip": "透明度を下げる" + } + } + }, + "GEOM/Transparency/Increase": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Increase transparency", + "tooltip": "Increase transparency" + }, + "fr": { + "name": "Augmenter la transparence", + "tooltip": "Augmenter la transparence" + }, + "ja": { + "name": "透明度を高める", + "tooltip": "透明度を高める" + } + } + }, + "GEOM/VTKPlugin/Export_VTK": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export VTK", + "tooltip": "Export VTK" + }, + "fr": { + "name": "Exporter VTK", + "tooltip": "Exporter VTK" + }, + "ja": { + "name": "VTKエクスポート", + "tooltip": "VTKエクスポート" + } + } + }, + "GEOM/XAOPlugin/Export_XAO": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Export XAO", + "tooltip": "Export XAO" + }, + "fr": { + "name": "Exporter XAO", + "tooltip": "Exporter XAO" + }, + "ja": { + "name": "XAOエクスポート", + "tooltip": "XAOのエクスポート" + } + } + }, + "GEOM/XAOPlugin/Import_XAO": { + "iconPath": "", + "langDependentAssets": { + "en": { + "name": "Import XAO", + "tooltip": "Import XAO" + }, + "fr": { + "name": "Importer XAO", + "tooltip": "Importer XAO" + }, + "ja": { + "name": "XAOインポート", + "tooltip": "XAOのインポート" + } + } + } +} diff --git a/src/BlockFix/BlockFix_SphereSpaceModifier.cxx b/src/BlockFix/BlockFix_SphereSpaceModifier.cxx index 50c67b212..c52d2a92f 100644 --- a/src/BlockFix/BlockFix_SphereSpaceModifier.cxx +++ b/src/BlockFix/BlockFix_SphereSpaceModifier.cxx @@ -138,6 +138,9 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& theFace, gp_Ax3 ax3 = sp.Position(); if (Abs(Vmax-Vmin) < PI2) { gp_Ax3 axnew3 (ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(), ax3.XDirection()); + if (!ax3.Direct()) { + axnew3.YReverse(); + } sp.SetPosition(axnew3); Handle(Geom_SphericalSurface) aNewSphere = new Geom_SphericalSurface(sp); theNewSurface = aNewSphere; @@ -157,6 +160,9 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& theFace, gp_Dir newNorm(gp_Vec(PC,PN)); gp_Dir newDirX(gp_Vec(PC,PX)); gp_Ax3 axnew3(ax3.Axis().Location(), newNorm, newDirX); + if (!ax3.Direct()) { + axnew3.YReverse(); + } sp.SetPosition(axnew3); // check if both new poles are outside theFace @@ -276,6 +282,10 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& theFace, } gp_Ax3 anAxisOfNewSphere (aCentre, anUp, XDirOfCircle); + gp_Ax3 ax3 = sp.Position(); + if (!ax3.Direct()) { + anAxisOfNewSphere.YReverse(); + } theNewSurface = new Geom_SphericalSurface (anAxisOfNewSphere, Radius); break; } //for (; itw.More(); itw.Next()) (iteration on outer wire) diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index 916f99e67..609f5fa8a 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -288,7 +288,9 @@ bool BuildGUI_WireDlg::execute (ObjectList& objects) for ( int i = 0; i < myEdgesAndWires.count(); i++ ) objlist[i] = myEdgesAndWires[i].copy(); - GEOM::GEOM_Object_var anObj = anOper->MakeWire(objlist.in(), GroupArgs->SpinBox_DX->value()); + GEOM::GEOM_Object_var anObj = anOper->MakeWire(objlist.in(), + GroupArgs->SpinBox_DX->value(), + GEOM::WBM_FixTolerance); if (!anObj->_is_nil()) objects.push_back(anObj._retn()); diff --git a/src/GEOMAlgo/CMakeLists.txt b/src/GEOMAlgo/CMakeLists.txt index 8a75aa730..39585b771 100644 --- a/src/GEOMAlgo/CMakeLists.txt +++ b/src/GEOMAlgo/CMakeLists.txt @@ -60,10 +60,7 @@ SET(GEOMAlgo_HEADERS GEOMAlgo_DataMapOfShapeMapOfShape.hxx GEOMAlgo_DataMapOfShapePnt.hxx GEOMAlgo_Extractor.hxx - GEOMAlgo_FinderShapeOn.hxx - GEOMAlgo_FinderShapeOn1.hxx GEOMAlgo_FinderShapeOn2.hxx - GEOMAlgo_FinderShapeOnQuad.hxx GEOMAlgo_GetInPlace.hxx GEOMAlgo_GetInPlaceAPI.hxx GEOMAlgo_GlueAnalyser.hxx diff --git a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx index 82401d0c9..7e9cc0b1b 100644 --- a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx +++ b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx @@ -80,7 +80,6 @@ #include #include #include -#include #include #include @@ -834,57 +833,6 @@ Standard_Integer GEOMAlgo_AlgoTools::RefineSDShapes // return 0; } -//======================================================================= -//function : BuildTriangulation -//purpose : -//======================================================================= -Standard_Boolean - GEOMAlgo_AlgoTools::BuildTriangulation (const TopoDS_Shape& theShape) -{ - // calculate deflection - Standard_Real aDeviationCoefficient = 0.001; - - Bnd_Box B; - BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; - Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; - Standard_Real aHLRAngle = 0.349066; - - // build triangulation - BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle); - - // check triangulation - bool isTriangulation = true; - - TopExp_Explorer exp (theShape, TopAbs_FACE); - if (exp.More()) - { - TopLoc_Location aTopLoc; - Handle(Poly_Triangulation) aTRF; - aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc); - if (aTRF.IsNull()) { - isTriangulation = false; - } - } - else // no faces, try edges - { - TopExp_Explorer expe (theShape, TopAbs_EDGE); - if (!expe.More()) { - isTriangulation = false; - } - else { - TopLoc_Location aLoc; - Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc); - if (aPE.IsNull()) { - isTriangulation = false; - } - } - } - return isTriangulation; -} //======================================================================= //function : IsCompositeShape diff --git a/src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx b/src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx index 793373fc0..2d318a1dc 100644 --- a/src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx +++ b/src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx @@ -87,9 +87,6 @@ class GEOMAlgo_AlgoTools { static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ; - Standard_EXPORT - static Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS) ; - Standard_EXPORT static Standard_Integer RefineSDShapes (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD, diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSolid.hxx b/src/GEOMAlgo/GEOMAlgo_ClsfSolid.hxx index 20a6e6033..039486cbe 100644 --- a/src/GEOMAlgo/GEOMAlgo_ClsfSolid.hxx +++ b/src/GEOMAlgo/GEOMAlgo_ClsfSolid.hxx @@ -25,10 +25,16 @@ #ifndef _GEOMAlgo_ClsfSolid_HeaderFile #define _GEOMAlgo_ClsfSolid_HeaderFile +#include + #include #include #include +#if OCC_VERSION_LARGE < 0x07080000 #include +#else +#include +#endif #include DEFINE_STANDARD_HANDLE(GEOMAlgo_ClsfSolid, GEOMAlgo_Clsf) diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx index 2dbddd353..973834342 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx @@ -25,14 +25,28 @@ #ifndef GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile #define GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile +#include + #include #include + +#if OCC_VERSION_LARGE < 0x07080000 #include #define _NCollection_MapHasher #include typedef NCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger; + +#else + +#include + +typedef NCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger; + +#endif // OCC_VERSION_LARGE < 0x07080000 + + typedef GEOMAlgo_DataMapOfPassKeyInteger::Iterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger; #undef _NCollection_MapHasher diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx deleted file mode 100644 index bf84c454c..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx +++ /dev/null @@ -1,611 +0,0 @@ -// 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 -// -// 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 -// - -// File: GEOMAlgo_FinderShapeOn.cxx -// Created: Tue Jan 11 14:44:31 2005 -// Author: Peter KURNEV - -#include - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -//======================================================================= -//function : GEOMAlgo_FinderShapeOn -//purpose : -//======================================================================= -GEOMAlgo_FinderShapeOn::GEOMAlgo_FinderShapeOn() -: - GEOMAlgo_ShapeAlgo() -{ - myTolerance=0.0001; - myShapeType=TopAbs_VERTEX; - myState=GEOMAlgo_ST_UNKNOWN; - myIsAnalytic=Standard_True; -} -//======================================================================= -//function : ~ -//purpose : -//======================================================================= -GEOMAlgo_FinderShapeOn::~GEOMAlgo_FinderShapeOn() -{ -} -//======================================================================= -//function : SetSurface -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::SetSurface(const Handle(Geom_Surface)& aS) -{ - mySurface=aS; -} -//======================================================================= -//function : Surface -//purpose : -//======================================================================= -const Handle(Geom_Surface)& GEOMAlgo_FinderShapeOn::Surface() const -{ - return mySurface; -} -//======================================================================= -//function : SetShapeType -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::SetShapeType(const TopAbs_ShapeEnum aType) -{ - myShapeType=aType; -} -//======================================================================= -//function : ShapeType -//purpose : -//======================================================================= -TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn::ShapeType()const -{ - return myShapeType; -} -//======================================================================= -//function : SetState -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::SetState(const GEOMAlgo_State aState) -{ - myState=aState; -} -//======================================================================= -//function : State -//purpose : -//======================================================================= -GEOMAlgo_State GEOMAlgo_FinderShapeOn::State() const -{ - return myState; -} -//======================================================================= -// function: Shapes -// purpose: -//======================================================================= -const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn::Shapes() const -{ - Standard_Boolean bIsConformState; - Standard_Integer i, aNb; - TopAbs_State aSt; - TopTools_ListOfShape* pL; - // - pL=(TopTools_ListOfShape*) &myLS; - pL->Clear(); - // - aNb=myMSS.Extent(); - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aS=myMSS.FindKey(i); - aSt=myMSS.FindFromIndex(i); - // - bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState); - if (bIsConformState) { - pL->Append(aS); - } - } - return myLS; -} -//======================================================================= -//function : Perform -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::Perform() -{ - myErrorStatus=0; - myWarningStatus=0; - myLS.Clear(); - myMSS.Clear(); - // - if (!myResult.IsNull()){ - myResult.Nullify(); - } - // - CheckData(); - if(myErrorStatus) { - return; - } - // - // Initialize the context - GEOMAlgo_ShapeAlgo::Perform(); - // - myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface); - // - MakeArgument1(); - if(myErrorStatus) { - return; - } - // - if (myIsAnalytic && myShapeType==TopAbs_VERTEX) { - FindVertices(); - return; - } - // - MakeArgument2(); - if(myErrorStatus) { - return; - } - // - Find(); - if(myErrorStatus || myWarningStatus) { - return; - } - // -} -//======================================================================= -//function : FindVertices -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::FindVertices() -{ - Standard_Integer i, aNb, iErr; - TopAbs_State aSt; - TopAbs_Orientation aOr; - gp_Pnt aP; - TopTools_IndexedMapOfShape aM; - // - TopExp::MapShapes(myArg1, TopAbs_FACE, aM); - const TopoDS_Face& aF=TopoDS::Face(aM(1)); - aOr=aF.Orientation(); - // - aM.Clear(); - TopExp::MapShapes(myShape, myShapeType, aM); - aNb=aM.Extent(); - if (!aNb) { - myWarningStatus=10; // No found sub-shapes of type myShapeType - return; - } - // - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aS=aM(i); - const TopoDS_Vertex& aV=TopoDS::Vertex(aS); - aP=BRep_Tool::Pnt(aV); - iErr=GEOMAlgo_SurfaceTools::GetState(aP, mySurface, myTolerance, aSt); - if (aOr==TopAbs_REVERSED) { - aSt=GEOMAlgo_SurfaceTools::ReverseState(aSt); - } - myMSS.Add(aS, aSt); - } -} -//======================================================================= -//function : Find -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::Find() -{ - Standard_Integer i, aNb; - Standard_Boolean bICS; - TopTools_IndexedMapOfShape aM; - // - TopExp::MapShapes(myArg2, myShapeType, aM); - // - aNb=aM.Extent(); - if (!aNb) { - myWarningStatus=10; // No found sub-shapes of type myShapeType - return; - } - // - bICS=GEOMAlgo_AlgoTools::IsCompositeShape(myArg2); - if (!bICS || myIsAnalytic) { - TopoDS_Compound aCmp; - BRep_Builder aBB; - // - aBB.MakeCompound(aCmp); - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aSi=aM(i); - aBB.Add(aCmp, aSi); - } - // - aM.Clear(); - aM.Add(aCmp); - aNb=1; - } - // - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aS=aM(i); - Find(aS); - if (myErrorStatus) { - return; - } - } -} -//======================================================================= -//function : Find -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS) -{ - myErrorStatus=0; - // - Standard_Integer i, iErr; - TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON}; - TopTools_ListIteratorOfListOfShape aIt; - BOPCol_ListOfShape aLS; - BOPAlgo_PaveFiller aPF; - // - // 1. Prepare DSFiller - aLS.Append(myArg1); - aLS.Append(aS); - aPF.SetArguments(aLS); - // - aPF.Perform(); - iErr=aPF.ErrorStatus(); - if (iErr) { - myErrorStatus=31; // PaveFiller is failed - return; - } - // - // 2. Find shapes - GEOMAlgo_ShapeSolid* pSS; - GEOMAlgo_VertexSolid aVXS; - GEOMAlgo_WireSolid aWRS; - GEOMAlgo_ShellSolid aSHS; - GEOMAlgo_SolidSolid aSLS; - // - pSS=NULL; - // - switch (myShapeType) { - case TopAbs_VERTEX: - pSS=&aVXS; - break; - case TopAbs_EDGE: - pSS=&aWRS; - break; - case TopAbs_FACE: - pSS=&aSHS; - break; - case TopAbs_SOLID: - aSLS.SetShape2(myArg2); - pSS=&aSLS; - break; - default: - myErrorStatus=12; // unallowed sub-shape type - return; - } - // - pSS->SetFiller(aPF); - pSS->Perform(); - iErr=pSS->ErrorStatus(); - if (iErr) { - myErrorStatus=32; // builder ShapeSolid failed - return; - } - // - for (i=0; i<3; ++i) { - const TopTools_ListOfShape& aLS=pSS->Shapes(aSts[i]); - aIt.Initialize(aLS); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aSImage=aIt.Value(); - if (myImages.IsBound(aSImage)) { - const TopoDS_Shape& aSx=myImages.Find(aSImage); - myMSS.Add(aSx, aSts[i]); - } - else { - myErrorStatus=33;// can not find original shape - return; - } - } - } -} -//======================================================================= -//function : MakeArgument1 -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::MakeArgument1() -{ - myErrorStatus=0; - // - Standard_Integer i, aNb; - TopAbs_ShapeEnum aType; - BRepLib_FaceError aFErr; - BRepLib_MakeFace aMF; - TopTools_IndexedMapOfShape aM; - BRep_Builder aBB; - TopoDS_Face aFace; - TopoDS_Shell aSh; - TopoDS_Solid aSd; - // - // Argument 1 - if (!myIsAnalytic) { - aMF.Init(mySurface, Standard_True, Precision::Confusion()); - - aFErr=aMF.Error(); - if (aFErr!=BRepLib_FaceDone) { - myErrorStatus=20; // can not build the face - return; - } - // - const TopoDS_Shape& aF=aMF.Shape(); - aFace=TopoDS::Face(aF); - // - // update tolerances - aM.Add(aF); - TopExp::MapShapes(aF, TopAbs_VERTEX, aM); - TopExp::MapShapes(aF, TopAbs_EDGE, aM); - - aNb=aM.Extent(); - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aS=aM(i); - aType=aS.ShapeType(); - switch (aType) { - case TopAbs_VERTEX: { - const TopoDS_Vertex& aVx=TopoDS::Vertex(aS); - aBB.UpdateVertex(aVx, myTolerance); - } - break; - case TopAbs_EDGE: { - const TopoDS_Edge& aEx=TopoDS::Edge(aS); - aBB.UpdateEdge(aEx, myTolerance); - } - break; - case TopAbs_FACE: { - const TopoDS_Face& aFx=TopoDS::Face(aS); - aBB.UpdateFace(aFx, myTolerance); - } - break; - default: - break; - } - } - } // - else { - aBB.MakeFace(aFace, mySurface, myTolerance); - } - // - // make solid - aBB.MakeShell(aSh); - aBB.Add(aSh, aFace); - aBB.MakeSolid(aSd); - aBB.Add(aSd, aSh); - myArg1=aSd; -} -//======================================================================= -//function : MakeArgument2 -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::MakeArgument2() -{ - myErrorStatus=0; - // - TopoDS_Shape aSC; - TopTools_DataMapOfShapeShape aOriginals; - // - myImages.Clear(); - // - GEOMAlgo_FinderShapeOn::CopySource(myShape, myImages, aOriginals, aSC); - // - myArg2=aSC; -} -//======================================================================= -//function : CheckData -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::CheckData() -{ - myErrorStatus=0; - // - if(mySurface.IsNull()) { - myErrorStatus=10; // mySurface=NULL - return; - } - // - if (myShape.IsNull()) { - myErrorStatus=11; // myShape=NULL - return; - } - // - if (!(myShapeType==TopAbs_VERTEX || - myShapeType==TopAbs_EDGE || - myShapeType==TopAbs_FACE || - myShapeType==TopAbs_SOLID)) { - myErrorStatus=12; // unallowed sub-shape type - return; - } - // - if (myState==GEOMAlgo_ST_UNKNOWN || - myState==GEOMAlgo_ST_INOUT) { - myErrorStatus=13; // unallowed state type - return; - } -} -// -//======================================================================= -//function : CopySource -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE, - TopTools_DataMapOfShapeShape& aImages, - TopTools_DataMapOfShapeShape& aOriginals, - TopoDS_Shape& aEx) -{ - Standard_Boolean bFree; - TopAbs_ShapeEnum aType; - Standard_Integer aR; - BRep_Builder BB; - TopoDS_Iterator aIt; - // - aType=aE.ShapeType(); - // - if (aOriginals.IsBound(aE)) { - aEx=aOriginals.ChangeFind(aE); - return; - } - else { - aEx=aE.EmptyCopied(); - aOriginals.Bind(aE, aEx); - aImages.Bind(aEx, aE); - } - // - aR=(Standard_Integer)aType+1; - if (aR>TopAbs_VERTEX) { - return; - } - // - bFree=aEx.Free(); - aEx.Free(Standard_True); - // - aType=(TopAbs_ShapeEnum) aR; - // - aIt.Initialize(aE);//, Standard_False); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aV=aIt.Value(); - TopoDS_Shape aVx; - // - CopySource (aV, aImages, aOriginals, aVx); - // - aVx.Orientation(aV.Orientation()); - BB.Add(aEx, aVx); - } - // - aEx.Free(bFree); -} -// -//======================================================================= -//function : BuildTriangulation -//purpose : -//======================================================================= -Standard_Boolean - GEOMAlgo_FinderShapeOn::BuildTriangulation (const TopoDS_Shape& theShape) -{ - // calculate deflection - Standard_Real aDeviationCoefficient = 0.001; - - Bnd_Box B; - BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; - Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; - Standard_Real aHLRAngle = 0.349066; - - // build triangulation - BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle); - - // check triangulation - bool isTriangulation = true; - - TopExp_Explorer exp (theShape, TopAbs_FACE); - if (exp.More()) - { - TopLoc_Location aTopLoc; - Handle(Poly_Triangulation) aTRF; - aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc); - if (aTRF.IsNull()) { - isTriangulation = false; - } - } - else // no faces, try edges - { - TopExp_Explorer expe (theShape, TopAbs_EDGE); - if (!expe.More()) { - isTriangulation = false; - } - else { - TopLoc_Location aLoc; - Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc); - if (aPE.IsNull()) { - isTriangulation = false; - } - } - } - - return isTriangulation; -} - -// -// myErrorStatus : -// -// 10 -mySurface=NULL -// 11 -myShape=NULL -// 12 -unallowed type of sub-shapes -// 13 -unallowed state -// 20 -can not build the face -// 30 -wrong args are used for DSFiller -// 31 -DSFiller failed -// 32 -builder ShapeSolid failed -// 33 -can not find original shape -// -// myWarningStatus -// -// 10 - sub-shapes of type myShapeType can not be fond in myShape diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx deleted file mode 100644 index cde1a3de5..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx +++ /dev/null @@ -1,125 +0,0 @@ - -// 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 -// -// 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 -// - -// File: GEOMAlgo_FinderShapeOn.hxx -// Created: Tue Jan 11 14:44:31 2005 -// Author: Peter KURNEV - -#ifndef _GEOMAlgo_FinderShapeOn_HeaderFile -#define _GEOMAlgo_FinderShapeOn_HeaderFile - -#include -#include -#include - -#include - -#include - -#include - -#include -#include - - -#include -#include -#include - -//======================================================================= -//function : GEOMAlgo_FinderShapeOn -//purpose : -//======================================================================= -class GEOMAlgo_FinderShapeOn : public GEOMAlgo_ShapeAlgo -{ - public: - Standard_EXPORT - GEOMAlgo_FinderShapeOn(); - - Standard_EXPORT - virtual ~GEOMAlgo_FinderShapeOn(); - - Standard_EXPORT - virtual void Perform() ; - - Standard_EXPORT - void SetSurface(const Handle(Geom_Surface)& aS) ; - - Standard_EXPORT - void SetShapeType(const TopAbs_ShapeEnum aST) ; - - Standard_EXPORT - void SetState(const GEOMAlgo_State aSF) ; - - Standard_EXPORT - const Handle(Geom_Surface)& Surface() const; - - Standard_EXPORT - TopAbs_ShapeEnum ShapeType() const; - - Standard_EXPORT - GEOMAlgo_State State() const; - - Standard_EXPORT - const TopTools_ListOfShape& Shapes() const; - - Standard_EXPORT - static void CopySource(const TopoDS_Shape& aS, - TopTools_DataMapOfShapeShape& aImages, - TopTools_DataMapOfShapeShape& aOriginals, - TopoDS_Shape& aSC) ; - - Standard_EXPORT - static Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS) ; - -protected: - Standard_EXPORT - virtual void CheckData() ; - - Standard_EXPORT - void MakeArgument1() ; - - Standard_EXPORT - void MakeArgument2() ; - - Standard_EXPORT - void Find() ; - - Standard_EXPORT - void Find(const TopoDS_Shape& aS) ; - - Standard_EXPORT - void FindVertices() ; - - - Handle(Geom_Surface) mySurface; - TopAbs_ShapeEnum myShapeType; - GEOMAlgo_State myState; - TopoDS_Shape myArg1; - TopoDS_Shape myArg2; - TopTools_ListOfShape myLS; - TopTools_DataMapOfShapeShape myImages; - GEOMAlgo_IndexedDataMapOfShapeState myMSS; - Standard_Boolean myIsAnalytic; -}; -#endif diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx deleted file mode 100644 index 64d50241e..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx +++ /dev/null @@ -1,787 +0,0 @@ -// 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 -// -// 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 -// - -// File: GEOMAlgo_FinderShapeOn1.cxx -// Created: Fri Mar 4 10:31:06 2005 -// Author: Peter KURNEV - -#include - -#include - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -//======================================================================= -//function : GEOMAlgo_FinderShapeOn1 -//purpose : -//======================================================================= -GEOMAlgo_FinderShapeOn1::GEOMAlgo_FinderShapeOn1() -: - GEOMAlgo_ShapeAlgo() -{ - myTolerance=0.0001; - myShapeType=TopAbs_VERTEX; - myState=GEOMAlgo_ST_UNKNOWN; - myNbPntsMin=3; - myNbPntsMax=0; -} -//======================================================================= -//function : ~ -//purpose : -//======================================================================= -GEOMAlgo_FinderShapeOn1::~GEOMAlgo_FinderShapeOn1() -{ -} -//======================================================================= -//function : SetSurface -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::SetSurface(const Handle(Geom_Surface)& aS) -{ - mySurface=aS; -} -//======================================================================= -//function : Surface -//purpose : -//======================================================================= -const Handle(Geom_Surface)& GEOMAlgo_FinderShapeOn1::Surface() const -{ - return mySurface; -} -//======================================================================= -//function : SetShapeType -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::SetShapeType(const TopAbs_ShapeEnum aType) -{ - myShapeType=aType; -} -//======================================================================= -//function : ShapeType -//purpose : -//======================================================================= -TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn1::ShapeType()const -{ - return myShapeType; -} -//======================================================================= -//function : SetState -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::SetState(const GEOMAlgo_State aState) -{ - myState=aState; -} -//======================================================================= -//function : State -//purpose : -//======================================================================= -GEOMAlgo_State GEOMAlgo_FinderShapeOn1::State() const -{ - return myState; -} -//======================================================================= -//function : SetNbPntsMin -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::SetNbPntsMin(const Standard_Integer aNb) -{ - myNbPntsMin=aNb; -} -//======================================================================= -//function : NbPntsMin -//purpose : -//======================================================================= -Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMin()const -{ - return myNbPntsMin; -} -//======================================================================= -//function : SetNbPntsMax -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::SetNbPntsMax(const Standard_Integer aNb) -{ - myNbPntsMax=aNb; -} -//======================================================================= -//function : NbPntsMax -//purpose : -//======================================================================= -Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMax()const -{ - return myNbPntsMax; -} -//======================================================================= -// function: MSS -// purpose: -//======================================================================= -const GEOMAlgo_IndexedDataMapOfShapeState& GEOMAlgo_FinderShapeOn1::MSS() const -{ - return myMSS; -} -//======================================================================= -// function: Shapes -// purpose: -//======================================================================= -const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn1::Shapes() const -{ - Standard_Integer i, aNb; - TopTools_ListOfShape* pL; - // - pL=(TopTools_ListOfShape*) &myLS; - pL->Clear(); - // - aNb=myMSS.Extent(); - for (i=1; i<=aNb; ++i) { - const TopoDS_Shape& aS=myMSS.FindKey(i); - if (aS.ShapeType()==myShapeType) { - pL->Append(aS); - } - } - return myLS; -} -//======================================================================= -//function : Perform -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::Perform() -{ - myErrorStatus=0; - myWarningStatus=0; - myLS.Clear(); - myMSS.Clear(); - // - CheckData(); - if(myErrorStatus) { - return; - } - // - // Initialize the context - GEOMAlgo_ShapeAlgo::Perform(); - // - // 1 - ProcessVertices(); - if(myErrorStatus) { - return; - } - if (myShapeType==TopAbs_VERTEX) { - return; - } - // - // 2 - ProcessEdges(); - if(myErrorStatus) { - return; - } - if (myShapeType==TopAbs_EDGE) { - return; - } - // - // 3 - ProcessFaces(); - if(myErrorStatus) { - return; - } - if (myShapeType==TopAbs_FACE) { - return; - } - // - // 4 - ProcessSolids(); - // -} -//======================================================================= -//function : ProcessVertices -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::ProcessVertices() -{ - myErrorStatus=0; - // - Standard_Boolean bIsConformState; - Standard_Integer i, aNb; - gp_Pnt aP; - TopTools_IndexedMapOfShape aM; - TopAbs_State aSt; - // - TopExp::MapShapes(myShape, TopAbs_VERTEX, aM); - aNb=aM.Extent(); - for (i=1; i<=aNb; ++i) { - const TopoDS_Vertex& aV=TopoDS::Vertex(aM(i)); - aP=BRep_Tool::Pnt(aV); - // - aSt = GetPointState( aP ); - bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState); - // - if (myShapeType==TopAbs_VERTEX){ - if (bIsConformState) { - myMSS.Add(aV, aSt); - } - } - else if (bIsConformState || aSt==TopAbs_ON) { - myMSS.Add(aV, aSt); - } - } -} -//======================================================================= -//function : ProcessEdges -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::ProcessEdges() -{ - myErrorStatus=0; - // - Standard_Boolean bIsConformState, bIsToBreak; - Standard_Integer i, aNb, iCnt; - TopAbs_State aSt; - TopTools_IndexedMapOfShape aM; - TopExp_Explorer aExp; - GEOMAlgo_ListIteratorOfListOfPnt aIt; - GeomAbs_SurfaceType aType1; - // - aType1=myGAS.GetType(); - // - TopExp::MapShapes(myShape, TopAbs_EDGE, aM); - // - bIsConformState=Standard_False; - // - aNb=aM.Extent(); - for (i=1; i<=aNb; ++i) { - GEOMAlgo_ListOfPnt aLP; - GEOMAlgo_StateCollector aSC; - // - const TopoDS_Edge& aE=TopoDS::Edge(aM(i)); - // - aExp.Init(aE, TopAbs_VERTEX); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Shape& aV=aExp.Current(); - // - bIsConformState=myMSS.Contains(aV); - if (!bIsConformState) { - break;// vertex has non-conformed state - } - else { - aSt=myMSS.FindFromKey(aV); - aSC.AppendState(aSt); - } - } - // - if (!bIsConformState) { - continue; // vertex has non-conformed state,skip edge - } - // - if (BRep_Tool::Degenerated(aE)) { - myMSS.Add(aE, aSt); - continue; - } - // - if (myState==GEOMAlgo_ST_ON && aType1==GeomAbs_Sphere) { - Standard_Real aT1, aT2; - Handle(Geom_Curve) aC; - GeomAdaptor_Curve aGAC; - GeomAbs_CurveType aType2; - // - aC=BRep_Tool::Curve(aE, aT1, aT2); - aGAC.Load(aC); - // - aType2=aGAC.GetType(); - if (aType2==GeomAbs_Line) { - continue; - } - } - // - InnerPoints(aE, aLP); - if (myErrorStatus) { - return; - } - // - bIsConformState=Standard_True; - aIt.Initialize(aLP); - for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) { - if (myNbPntsMax) { - if (iCnt > myNbPntsMax) { - break; - } - } - // - const gp_Pnt& aP=aIt.Value(); - aSt = GetPointState( aP ); - bIsToBreak=aSC.AppendState(aSt); - if (bIsToBreak) { - break; - } - } - // - aSt=aSC.State(); - // - bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState); - if (myShapeType==TopAbs_EDGE) { - if (bIsConformState) { - myMSS.Add(aE, aSt); - } - } - else if (bIsConformState || aSt==TopAbs_ON) { - myMSS.Add(aE, aSt); - } - } // for (i=1; i<=aNb; ++i) next edge -} -//======================================================================= -//function : ProcessFaces -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::ProcessFaces() -{ - myErrorStatus=0; - // - Standard_Boolean bIsConformState, bIsToBreak; - Standard_Integer i, aNbF, iCnt; - TopAbs_State aSt; - TopTools_IndexedMapOfShape aM; - TopExp_Explorer aExp; - GEOMAlgo_ListIteratorOfListOfPnt aIt; - GeomAbs_SurfaceType aType1, aType2; - // - aType1=myGAS.GetType(); - // - TopExp::MapShapes(myShape, TopAbs_FACE, aM); - aNbF=aM.Extent(); - for (i=1; i<=aNbF; ++i) { - GEOMAlgo_StateCollector aSC; - GEOMAlgo_ListOfPnt aLP; - // - const TopoDS_Face& aF=TopoDS::Face(aM(i)); - // - if (myState==GEOMAlgo_ST_ON) { - Handle(Geom_Surface) aS; - GeomAdaptor_Surface aGAS; - // - aS=BRep_Tool::Surface(aF); - aGAS.Load(aS); - aType2=aGAS.GetType(); - if (aType2!=aType1) { - continue; - } - } - // - bIsConformState=Standard_False; - // - aExp.Init(aF, TopAbs_EDGE); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Shape& aE=aExp.Current(); - bIsConformState=myMSS.Contains(aE); - if (!bIsConformState) { - break;// edge has non-conformed state - } - else { - aSt=myMSS.FindFromKey(aE); - aSC.AppendState(aSt); - } - } - // - if (!bIsConformState) { - continue; // edge has non-conformed state,skip face - } - // - InnerPoints(aF, aLP); - if (myErrorStatus) { - return; - } - // - bIsConformState=Standard_True; - aIt.Initialize(aLP); - for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) { - if (myNbPntsMax) { - if (iCnt > myNbPntsMax) { - break; - } - } - // - const gp_Pnt& aP=aIt.Value(); - aSt = GetPointState( aP ); - bIsToBreak=aSC.AppendState(aSt); - if (bIsToBreak) { - break; - } - } - // - aSt=aSC.State(); - // - bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState); - if (myShapeType==TopAbs_FACE) { - if (bIsConformState) { - myMSS.Add(aF, aSt); - } - } - else if (bIsConformState || aSt==TopAbs_ON) { - myMSS.Add(aF, aSt); - } - }// for (i=1; i<=aNb; ++i) next face -} -//======================================================================= -//function : ProcessSolids -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::ProcessSolids() -{ - myErrorStatus=0; - // - Standard_Boolean bIsConformState; - Standard_Integer i, aNbS, j, aNbF; - TopTools_IndexedMapOfShape aM, aMF; - TopAbs_State aSt; - // - TopExp::MapShapes(myShape, TopAbs_SOLID, aM); - aNbS=aM.Extent(); - for (i=1; i<=aNbS; ++i) { - GEOMAlgo_StateCollector aSC; - // - const TopoDS_Shape& aSd=aM(i); - aMF.Clear(); - TopExp::MapShapes(aSd, TopAbs_FACE, aMF); - // - bIsConformState=Standard_False; - // - aNbF=aMF.Extent(); - for (j=1; j<=aNbF; ++j) { - const TopoDS_Shape& aF=aMF(j); - bIsConformState=myMSS.Contains(aF); - if (!bIsConformState) { - break;// face has non-conformed state - } - else { - aSt=myMSS.FindFromKey(aF); - aSC.AppendState(aSt); - } - } - // - if (!bIsConformState) { - continue; // face has non-conformed state,skip solid - } - // - aSt=aSC.State(); - // - bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState); - if (bIsConformState) { - myMSS.Add(aSd, aSt); - } - } -} -// -//======================================================================= -//function : InnerPoints -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF, - GEOMAlgo_ListOfPnt& aLP) -{ - myErrorStatus=0; - // - Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds; - TopLoc_Location aLoc; - Handle(Poly_Triangulation) aTRF; - TColStd_MapOfInteger aMBN; - GEOMAlgo_DataMapOfPassKeyInteger aMPKI; - GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt; - gp_Pnt aP, aP1, aP2; - // - aLP.Clear(); - // - aTRF=BRep_Tool::Triangulation(aF, aLoc); - if (aTRF.IsNull()) { - if (!GEOMAlgo_AlgoTools::BuildTriangulation(aF)) { - myWarningStatus=20; // no triangulation found - return; - } - aTRF=BRep_Tool::Triangulation(aF, aLoc); - } - // - const gp_Trsf& aTrsf=aLoc.Transformation(); - const Poly_Array1OfTriangle& aTrs=aTRF->Triangles(); - const TColgp_Array1OfPnt& aNodes=aTRF->Nodes(); - // - // map link/nbtriangles - j1=aTrs.Lower(); - j2=aTrs.Upper(); - for (j=j1; j<=j2; ++j) { - const Poly_Triangle& aTr=aTrs(j); - aTr.Get(n[0], n[1], n[2]); - n[3]=n[0]; - for (k=0; k<3; ++k) { - GEOMAlgo_PassKey aPK; - // - aPK.SetIds(n[k], n[k+1]); - if (aMPKI.IsBound(aPK)) { - Standard_Integer& iCntX=aMPKI.ChangeFind(aPK); - ++iCntX; - } - else { - aMPKI.Bind(aPK, 1); - } - } - } - // - // boundary nodes aMBN - aNbLinks=aMPKI.Extent(); - aIt.Initialize(aMPKI); - for (; aIt.More(); aIt.Next()) { - iCnt=aIt.Value(); - if (iCnt==1) { - const GEOMAlgo_PassKey& aPK=aIt.Key(); - // - aNx=(Standard_Integer)aPK.Id(1); - aMBN.Add(aNx); - aNx=(Standard_Integer)aPK.Id(2); - aMBN.Add(aNx); - } - } - // - // inner nodes=all_nodes - boundary_nodes - j1=aNodes.Lower(); - j2=aNodes.Upper(); - for (j=j1; j<=j2; ++j) { - if (!aMBN.Contains(j)) { - aP=aNodes(j).Transformed(aTrsf); - aLP.Append(aP); - } - } - // - aNb=aLP.Extent(); - // - if (!aNb && myNbPntsMin) { - // try to fill it yourself - Standard_Boolean bIsDone; - Standard_Integer aN1, aN2; - Handle(Geom_Surface) aS; - GeomAdaptor_Surface aGAS; - GeomAbs_SurfaceType aType; - // - aS=BRep_Tool::Surface(aF); - aGAS.Load(aS); - aType=aGAS.GetType(); - if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) { - // inner links - aNbLinks=aMPKI.Extent(); - aIt.Initialize(aMPKI); - for (; aIt.More(); aIt.Next()) { - iCnt=aIt.Value(); - if (iCnt>1) { - // take the first having occurred inner link - // and discretize it - const GEOMAlgo_PassKey& aPK=aIt.Key(); - // - aN1=(Standard_Integer)aPK.Id(1); - aN2=(Standard_Integer)aPK.Id(2); - // - aP1=aNodes(aN1).Transformed(aTrsf); - aP2=aNodes(aN2).Transformed(aTrsf); - // - if (aType==GeomAbs_Cylinder) { - gp_Cylinder aCyl; - // - aCyl=aGAS.Cylinder(); - if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, myTolerance)) { - continue; - } - } - // - BRepLib_MakeEdge aBME(aP1, aP2); - bIsDone=aBME.IsDone(); - if (!bIsDone) { - myErrorStatus=30; //can not obtain the line from the link - return; - } - // - const TopoDS_Shape& aSx=aBME.Shape(); - const TopoDS_Edge& aE=TopoDS::Edge(aSx); - // - InnerPoints(aE, myNbPntsMin, aLP); - break; - }// if (iCnt>1) - }// for (; aIt.More(); aIt.Next()) - }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) - }// if (!aNb && myNbPntsMin) { -} -//======================================================================= -//function : InnerPoints -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE, - GEOMAlgo_ListOfPnt& aLP) -{ - Standard_Integer aNbPntsMin; - // - myErrorStatus=0; - aNbPntsMin=21; - // - aLP.Clear(); - InnerPoints(aE, aNbPntsMin, aLP); -} -//======================================================================= -//function : InnerPoints -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE, - const Standard_Integer aNbPntsMin, - GEOMAlgo_ListOfPnt& aLP) -{ - Standard_Boolean bInf1, bInf2; - Standard_Integer j, aNbT; - Standard_Real dT, aT, aT1, aT2; - gp_Pnt aP; - Handle(Geom_Curve) aC3D; - // - aC3D=BRep_Tool::Curve(aE, aT1, aT2); - if (aC3D.IsNull()) { - return; - } - // - bInf1=Precision::IsNegativeInfinite(aT1); - bInf2=Precision::IsPositiveInfinite(aT2); - if (bInf1 || bInf2) { - return; - } - // - aNbT=aNbPntsMin+1; - dT=(aT2-aT1)/aNbT; - for (j=1; jD0(aT, aP); - aLP.Append(aP); - } -} - -//======================================================================= -//function : CheckData -//purpose : -//======================================================================= -void GEOMAlgo_FinderShapeOn1::CheckData() -{ - myErrorStatus=0; - // - if(mySurface.IsNull()) { - myErrorStatus=10; // mySurface=NULL - return; - } - // - if (myShape.IsNull()) { - myErrorStatus=11; // myShape=NULL - return; - } - // - if (!(myShapeType==TopAbs_VERTEX || - myShapeType==TopAbs_EDGE || - myShapeType==TopAbs_FACE || - myShapeType==TopAbs_SOLID)) { - myErrorStatus=12; // unallowed subshape type - return; - } - // - if (myState==GEOMAlgo_ST_UNKNOWN || - myState==GEOMAlgo_ST_INOUT) { - myErrorStatus=13; // unallowed state type - return; - } - // - GeomAbs_SurfaceType aType; - // - myGAS.Load(mySurface); - aType=myGAS.GetType(); - if (!(aType==GeomAbs_Plane || - aType==GeomAbs_Cylinder || - aType==GeomAbs_Sphere)) { - myErrorStatus=14; // unallowed surface type - } -} - -//======================================================================= -//function : GetPointState -//purpose : -//======================================================================= - -TopAbs_State GEOMAlgo_FinderShapeOn1::GetPointState(const gp_Pnt& aP) -{ - TopAbs_State aSt; - GEOMAlgo_SurfaceTools::GetState(aP, myGAS, myTolerance, aSt); - return aSt; -} - - -// -// myErrorStatus : -// -// 10 -mySurface=NULL -// 11 -myShape=NULL -// 12 -unallowed type of subshapes -// 13 -unallowed state -// 14 -unallowed surface type -// 15 -unallowed surface type -// 20- no triangulation found -// 30- can not obtain the line from the link - diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.hxx deleted file mode 100644 index 5f67b1090..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.hxx +++ /dev/null @@ -1,145 +0,0 @@ -// 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 -// -// 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 -// - -// File: GEOMAlgo_FinderShapeOn1.hxx -// Created: Fri Mar 4 10:31:06 2005 -// Author: Peter KURNEV - -#ifndef _GEOMAlgo_FinderShapeOn1_HeaderFile -#define _GEOMAlgo_FinderShapeOn1_HeaderFile - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -//======================================================================= -//function : GEOMAlgo_FinderShapeOn1 -//purpose : -//======================================================================= -class GEOMAlgo_FinderShapeOn1 : public GEOMAlgo_ShapeAlgo -{ - public: - Standard_EXPORT - GEOMAlgo_FinderShapeOn1(); - - Standard_EXPORT - virtual ~GEOMAlgo_FinderShapeOn1(); - - Standard_EXPORT - void SetSurface(const Handle(Geom_Surface)& aS) ; - - Standard_EXPORT - void SetShapeType(const TopAbs_ShapeEnum aST) ; - - Standard_EXPORT - void SetState(const GEOMAlgo_State aSF) ; - - Standard_EXPORT - void SetNbPntsMin(const Standard_Integer aNb) ; - - Standard_EXPORT - Standard_Integer NbPntsMin() const; - - Standard_EXPORT - void SetNbPntsMax(const Standard_Integer aNb) ; - - Standard_EXPORT - Standard_Integer NbPntsMax() const; - - Standard_EXPORT - const Handle(Geom_Surface)& Surface() const; - - Standard_EXPORT - TopAbs_ShapeEnum ShapeType() const; - - Standard_EXPORT - GEOMAlgo_State State() const; - - Standard_EXPORT - virtual void Perform() ; - - Standard_EXPORT - const TopTools_ListOfShape& Shapes() const; - - Standard_EXPORT - const GEOMAlgo_IndexedDataMapOfShapeState& MSS() const; - - protected: - Standard_EXPORT - virtual void CheckData() ; - - Standard_EXPORT - void ProcessVertices() ; - - Standard_EXPORT - void ProcessEdges() ; - - Standard_EXPORT - void ProcessFaces() ; - - Standard_EXPORT - void ProcessSolids() ; - - Standard_EXPORT - void InnerPoints(const TopoDS_Face& aF, - GEOMAlgo_ListOfPnt& aLP) ; - - Standard_EXPORT - void InnerPoints(const TopoDS_Edge& aE, - GEOMAlgo_ListOfPnt& aLP) ; - - Standard_EXPORT - void InnerPoints(const TopoDS_Edge& aE, - const Standard_Integer aNbPnts, - GEOMAlgo_ListOfPnt& aLP) ; - - Standard_EXPORT - virtual TopAbs_State GetPointState(const gp_Pnt& aP) ; - - - Handle(Geom_Surface) mySurface; - TopAbs_ShapeEnum myShapeType; - GEOMAlgo_State myState; - Standard_Integer myNbPntsMin; - Standard_Integer myNbPntsMax; - GeomAdaptor_Surface myGAS; - TopTools_ListOfShape myLS; - GEOMAlgo_IndexedDataMapOfShapeState myMSS; -}; - -#endif diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx index 5fd59d517..34509300b 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx @@ -33,6 +33,8 @@ #include #include +#include + #include #include #include @@ -606,14 +608,13 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF, // aLP.Clear(); // - aTRF=BRep_Tool::Triangulation(aF, aLoc); - if (aTRF.IsNull()) { - if (!BuildTriangulation(aF)) { - myWarningStatus=20; // no triangulation found - return; - } - aTRF=BRep_Tool::Triangulation(aF, aLoc); + if (!GEOMUtils::MeshShape(aF, /*deflection*/0.001, /*forced*/false, + /*angle deflection*/0.349066, /*isRelative*/true, + /*doPostCheck*/true)) { + myWarningStatus=20; // no triangulation found + return; } + aTRF=BRep_Tool::Triangulation(aF, aLoc); // const gp_Trsf& aTrsf=aLoc.Transformation(); // @@ -745,16 +746,15 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE, gp_Pnt aP; // aLP.Clear(); + if (!GEOMUtils::MeshShape(aE, /*deflection*/0.001, /*forced*/false, + /*angle deflection*/0.349066, /*isRelative*/true, + /*doPostCheck*/true)) { + myErrorStatus=20; // no triangulation found + return; + } BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc); if (aTRE.IsNull() || aPTE.IsNull()) { Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc); - if (aPE.IsNull()) { - if (!BuildTriangulation(aE)) { - myErrorStatus=20; // no triangulation found - return; - } - aPE = BRep_Tool::Polygon3D(aE, aLoc); - } const gp_Trsf& aTrsf=aLoc.Transformation(); const TColgp_Array1OfPnt& aNodes=aPE->Nodes(); // @@ -819,59 +819,6 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE, } } -//======================================================================= -//function : BuildTriangulation -//purpose : -//======================================================================= -Standard_Boolean - GEOMAlgo_FinderShapeOn2::BuildTriangulation (const TopoDS_Shape& theShape) -{ - // calculate deflection - Standard_Real aDeviationCoefficient = 0.001; - - Bnd_Box B; - BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; - Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; - Standard_Real aHLRAngle = 0.349066; - - // build triangulation - BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle); - - // check triangulation - bool isTriangulation = true; - - TopExp_Explorer exp (theShape, TopAbs_FACE); - if (exp.More()) - { - TopLoc_Location aTopLoc; - Handle(Poly_Triangulation) aTRF; - aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc); - if (aTRF.IsNull()) { - isTriangulation = false; - } - } - else // no faces, try edges - { - TopExp_Explorer expe (theShape, TopAbs_EDGE); - if (!expe.More()) { - isTriangulation = false; - } - else { - TopLoc_Location aLoc; - Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc); - if (aPE.IsNull()) { - isTriangulation = false; - } - } - } - - return isTriangulation; -} - // // myErrorStatus : // diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx index 8f999f393..6824e3c59 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx @@ -126,9 +126,6 @@ protected: const Standard_Integer aNbPnts, GEOMAlgo_ListOfPnt& aLP) ; - Standard_EXPORT - Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS) ; - TopAbs_ShapeEnum myShapeType; GEOMAlgo_State myState; diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.cxx deleted file mode 100644 index 908cb4762..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.cxx +++ /dev/null @@ -1,144 +0,0 @@ -// 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 -// -// 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 -// - -// File : GEOMAlgo_FinderShapeOnQuad.cxx -// Created : Mon Oct 17 17:31:45 2005 -// Author : Edward AGAPOV (eap) -// -#include "GEOMAlgo_FinderShapeOnQuad.hxx" -#include "GEOMAlgo_SurfaceTools.hxx" - -#include -#include -#include - - -GEOMAlgo_FinderShapeOnQuad::GEOMAlgo_FinderShapeOnQuad(const gp_Pnt & theTopLeftPoint, - const gp_Pnt & theTopRightPoint, - const gp_Pnt & theBottomLeftPoint, - const gp_Pnt & theBottomRightPoint) -{ - myPoints.resize(6); - myPoints[0] = theTopLeftPoint ; - myPoints[1] = theTopRightPoint ; - myPoints[2] = theBottomRightPoint; - myPoints[3] = theBottomLeftPoint ; - myPoints[4] = myPoints[0]; - myPoints[5] = myPoints[1]; - - // Find plane normal defined by corner points, it will be used to define a plane - // for each quadrangle side. - myQuadNormal.SetCoord (0,0,0); - for ( int i = 1; i <= 4; ++i ) - myQuadNormal += gp_Vec( myPoints[i], myPoints[i+1] ) ^ gp_Vec( myPoints[i], myPoints[i-1] ); - //std::cout< point2 vector - gp_Vec aSideVec( myPoints[ i ], myPoints[ i + 1 ]); - //std::cout<<" Y Vec : "<Axis().Direction(); - gp_Vec aSideVec = myQuadNormal ^ aSideNorm; - gp_Vec c1p ( myPoints[i], aP ); - gp_Vec pc2 ( aP, myPoints[i+1] ); - if ( aSideVec * c1p >= 0. && aSideVec * pc2 >= 0. ) - return TopAbs_ON; - // consider to be IN (???????????) - //nbIn += myConcaveSide[i] ? 0.5 : 1.0; - } - } - Standard_Real inThreshold = myPlanes.size(); // usually 4.0 - if ( myConcaveQuad ) - inThreshold = 2.5; // 1.0 + 1.0 + 0.5 - - if ( nbIn >= inThreshold ) - return TopAbs_IN; - - return TopAbs_OUT; -} - diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.hxx deleted file mode 100644 index 84b6fc0fe..000000000 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.hxx +++ /dev/null @@ -1,61 +0,0 @@ -// 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 -// -// 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 -// - -// File : GEOMAlgo_FinderShapeOnQuad.hxx -// Created : Mon Oct 17 17:15:59 2005 -// Author : Edward AGAPOV (eap) -// -#ifndef GEOMAlgo_FinderShapeOnQuad_HeaderFile -#define GEOMAlgo_FinderShapeOnQuad_HeaderFile - -#include "GEOMAlgo_FinderShapeOn1.hxx" - -#include - -#include - - -class GEOMAlgo_FinderShapeOnQuad: public GEOMAlgo_FinderShapeOn1 -{ -public: - - Standard_EXPORT - GEOMAlgo_FinderShapeOnQuad(const gp_Pnt & theTopLeftPoint, - const gp_Pnt & theTopRightPoint, - const gp_Pnt & theBottomLeftPoint, - const gp_Pnt & theBottomRightPoint); - -protected: - - virtual void CheckData() ; - - virtual TopAbs_State GetPointState(const gp_Pnt& aP) ; - -private: - - bool myConcaveQuad; - std::vector myConcaveSide; - std::vector myPoints; - std::vector myPlanes; - gp_Vec myQuadNormal; -}; -#endif diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx index c848ff86c..68ad864de 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx @@ -29,6 +29,11 @@ #include #include + +#include + +#if OCC_VERSION_LARGE < 0x07080000 + #include #define _NCollection_MapHasher @@ -39,6 +44,13 @@ typedef NCollection_IndexedDataMap + +typedef NCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfIntegerShape; + +#endif // OCC_VERSION_LARGE < 0x07080000 #endif diff --git a/src/GEOMAlgo/GEOMAlgo_PassKey.cxx b/src/GEOMAlgo/GEOMAlgo_PassKey.cxx index 9f052c40f..2a031c2b0 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKey.cxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKey.cxx @@ -206,6 +206,7 @@ static } return !bRet; } +#if OCC_VERSION_LARGE < 0x07080000 //======================================================================= //function : HashCode //purpose : @@ -214,6 +215,7 @@ static { return ::HashCode(mySum, aUpper); } +#endif //======================================================================= //function : Dump //purpose : diff --git a/src/GEOMAlgo/GEOMAlgo_PassKey.hxx b/src/GEOMAlgo/GEOMAlgo_PassKey.hxx index 77a74f073..bb5185689 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKey.hxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKey.hxx @@ -28,6 +28,8 @@ #ifndef _GEOMAlgo_PassKey_HeaderFile #define _GEOMAlgo_PassKey_HeaderFile +#include + #include #include #include @@ -88,8 +90,19 @@ class GEOMAlgo_PassKey { Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const; +#if OCC_VERSION_LARGE < 0x07080000 Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const; +#endif + + Standard_EXPORT + bool operator==(const GEOMAlgo_PassKey& theOther) const + { + return IsEqual(theOther); + } + + Standard_EXPORT + size_t GetSum() const { return (size_t)mySum; } Standard_EXPORT Standard_Integer Id(const Standard_Integer aIndex) const; @@ -102,4 +115,16 @@ class GEOMAlgo_PassKey { Standard_Integer mySum; TColStd_IndexedMapOfInteger myMap; }; + +namespace std +{ + template <> + struct hash + { + size_t operator()(const GEOMAlgo_PassKey& thePK) const noexcept + { + return thePK.GetSum(); + } + }; +} #endif diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx b/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx index 79d55846e..9918596b4 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx @@ -27,6 +27,8 @@ // #include +#if OCC_VERSION_LARGE < 0x07080000 + //======================================================================= //function : HashCode //purpose : @@ -45,3 +47,18 @@ { return aPK1.IsEqual(aPK2); } + +#else + +size_t GEOMAlgo_PassKeyMapHasher::operator()(const GEOMAlgo_PassKey& aPKey) const +{ + return aPKey.GetSum(); +} + +bool GEOMAlgo_PassKeyMapHasher::operator()(const GEOMAlgo_PassKey& aPKey1, + const GEOMAlgo_PassKey& aPKey2) const +{ + return aPKey1.IsEqual(aPKey2); +} + +#endif // OCC_VERSION_LARGE < 0x07080000 diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.hxx b/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.hxx index a6ce772af..144d5d14c 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.hxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.hxx @@ -34,12 +34,15 @@ #include #include +#include + //======================================================================= //class : GEOMAlgo_PassKeyMapHasher //purpose : //======================================================================= class GEOMAlgo_PassKeyMapHasher { public: +#if OCC_VERSION_LARGE < 0x07080000 Standard_EXPORT static Standard_Integer HashCode(const GEOMAlgo_PassKey& aPKey, const Standard_Integer Upper) ; @@ -47,5 +50,13 @@ class GEOMAlgo_PassKeyMapHasher { Standard_EXPORT static Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aPKey1, const GEOMAlgo_PassKey& aPKey2) ; +#else + Standard_EXPORT + size_t operator()(const GEOMAlgo_PassKey& aPKey) const; + + Standard_EXPORT + bool operator()(const GEOMAlgo_PassKey& aPKey1, + const GEOMAlgo_PassKey& aPKey2) const; +#endif // OCC_VERSION_LARGE < 0x07080000 }; #endif diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx index fa0c73ee7..e4ceeb154 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx @@ -27,6 +27,8 @@ // #include +#include + #include #include @@ -94,7 +96,11 @@ static Clear(); myNbIds=1; myMap.Add(aS1); +#if OCC_VERSION_LARGE < 0x07080000 aHC=aS1.HashCode(myUpper); +#else + aHC = std::hash{}(aS1); +#endif mySum=NormalizedId(aHC, myNbIds); } //======================================================================= @@ -160,7 +166,11 @@ static myNbIds=myMap.Extent(); for(i=1; i<=myNbIds; ++i) { const TopoDS_Shape& aS=myMap(i); +#if OCC_VERSION_LARGE < 0x07080000 aId=aS.HashCode(myUpper); +#else + aId = std::hash{}(aS); +#endif aIdN=NormalizedId(aId, myNbIds); mySum+=aIdN; } @@ -195,6 +205,7 @@ static } return !bRet; } +#if OCC_VERSION_LARGE < 0x07080000 //======================================================================= //function : HashCode //purpose : @@ -203,6 +214,7 @@ static { return ::HashCode(mySum, aUpper); } +#endif //======================================================================= //function : Dump //purpose : diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx index f846bfbf7..4ea580317 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx @@ -29,6 +29,8 @@ #ifndef _GEOMAlgo_PassKeyShape_HeaderFile #define _GEOMAlgo_PassKeyShape_HeaderFile +#include + #include #include #include @@ -90,8 +92,19 @@ class GEOMAlgo_PassKeyShape { Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aOther) const; +#if OCC_VERSION_LARGE < 0x07080000 Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const; +#endif + + Standard_EXPORT + bool operator==(const GEOMAlgo_PassKeyShape& theOther) const + { + return IsEqual(theOther); + } + + Standard_EXPORT + size_t GetSum() const { return (size_t)mySum; } Standard_EXPORT void Dump(const Standard_Integer aHex = 0) const; diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx index 7e1dccbc1..e926870f9 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx @@ -27,6 +27,8 @@ // #include +#if OCC_VERSION_LARGE < 0x07080000 + //======================================================================= //function : HashCode //purpose : @@ -45,3 +47,18 @@ { return aPK1.IsEqual(aPK2); } + +#else + +size_t GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey) const +{ + return aPKey.GetSum(); +} + +bool GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey1, + const GEOMAlgo_PassKeyShape& aPKey2) const +{ + return aPKey1.IsEqual(aPKey2); +} + +#endif // OCC_VERSION_LARGE < 0x07080000 diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx index 921d53db2..c656c45a4 100644 --- a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx +++ b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx @@ -34,6 +34,8 @@ #include #include +#include + //======================================================================= //class : GEOMAlgo_PassKeyShapeMapHasher //purpose : @@ -41,6 +43,7 @@ class GEOMAlgo_PassKeyShapeMapHasher { public: +#if OCC_VERSION_LARGE < 0x07080000 Standard_EXPORT static Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey, const Standard_Integer Upper) ; @@ -48,5 +51,13 @@ class GEOMAlgo_PassKeyShapeMapHasher Standard_EXPORT static Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1, const GEOMAlgo_PassKeyShape& aPKey2) ; +#else + Standard_EXPORT + size_t operator()(const GEOMAlgo_PassKeyShape& aPKey) const; + + Standard_EXPORT + bool operator()(const GEOMAlgo_PassKeyShape& aPKey1, + const GEOMAlgo_PassKeyShape& aPKey2) const; +#endif // OCC_VERSION_LARGE < 0x07080000 }; #endif diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx index 7885f7b6b..e5b61b286 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx @@ -336,7 +336,7 @@ void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS) aP0=aPln.Location(); aAx3=aPln.Position(); // - aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE); + aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE); aInfo.SetKindOfName(GEOMAlgo_KN_PLANE); aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED); aInfo.SetLocation(aP0); @@ -420,38 +420,52 @@ void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS) //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||| // 4. Cone else if (aST==GeomAbs_Cone) { - Standard_Real aSemiAngle; - gp_Cone aCone; - // - aCone=aGAS.Cone(); - aP0=aCone.Location(); - aAx3=aCone.Position(); + const gp_Cone aCone=aGAS.Cone(); // aInfo.SetKindOfShape(GEOMAlgo_KS_CONE); aInfo.SetKindOfName(GEOMAlgo_KN_CONE); - aInfo.SetLocation(aP0); - aInfo.SetPosition(aAx3); // BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); + bInfU1=Precision::IsNegativeInfinite(aUMin); bInfU2=Precision::IsPositiveInfinite(aUMax); bInfV1=Precision::IsNegativeInfinite(aVMin); bInfV2=Precision::IsPositiveInfinite(aVMax); // - bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2); + bInf=bInfV1 || bInfV2; if (bInf) { + aP0=aAx3.Location(); + aAx3=aCone.Position(); + aInfo.SetLocation(aP0); + aInfo.SetPosition(aAx3); aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE); return; } // aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); // - aSemiAngle=fabs(aCone.SemiAngle()); - dV=(aVMax-aVMin)*cos(aSemiAngle); - - aInfo.SetHeight(dV); - // - FillDetails(aF, aCone); + const Standard_Real aSemiAngle = aCone.SemiAngle(); + + dV = aVMax - aVMin; + Standard_Real H = dV * std::cos(aSemiAngle); + + aAx3 = aCone.Position(); + Standard_Real aShiftAlongAxisLength = aVMin * std::cos(aSemiAngle); // Required, because R1 does not equal to gp_Cone.RefRadius() in general case, and gp_Cone.Location() corresponds to the latter one. + auto aShiftAlongAxis = gp_Vec(aAx3.Direction().XYZ()); + aShiftAlongAxis *= aShiftAlongAxisLength; + aAx3.Translate(aShiftAlongAxis); + + aP0=aAx3.Location(); + aInfo.SetLocation(aP0); + aInfo.SetPosition(aAx3); + + aR1 = aCone.RefRadius() + aVMin * std::sin(aSemiAngle); + aR2 = aCone.RefRadius() + aVMax * std::sin(aSemiAngle); + + aInfo.SetRadius1(aR1); + aInfo.SetRadius2(aR2); + aInfo.SetHeight(H); + aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED); } // //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||| diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.hxx b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.hxx index 6b9480e03..1943c698f 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.hxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.hxx @@ -112,9 +112,6 @@ class GEOMAlgo_ShapeInfoFiller : public GEOMAlgo_Algo Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Cylinder& aCyl) ; - Standard_EXPORT - void FillDetails(const TopoDS_Face& aF,const gp_Cone& aCone) ; - Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Torus& aTorus) ; diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx index 6731ee2ca..50ed77127 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx @@ -103,13 +103,13 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd) aKD=aInfoF.KindOfDef(); } if (aKD!=GEOMAlgo_KD_SPECIFIED) { - aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); + aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); return; } // aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd); if (aNbShells>1) { - aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); + aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); return; } // @@ -396,7 +396,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, if (bSegment) { // 2. may be it is TRIANGLE, POLYGON, QUADRANGLE, RECTANGLE aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED); - aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON); + aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON); // if (aNbV==3 && aNbE==3) { aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE); @@ -480,7 +480,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, // aLength=aD1; aWidth =aD0; - + if (aD0>aD1) { aLength=aD0; aWidth =aD1; @@ -515,7 +515,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, const gp_Sphere& )//aSph) { - + Standard_Integer aNbV, aNbE, aNbSE, aNbDE; TopoDS_Edge aE; TopExp_Explorer aExp; @@ -523,7 +523,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, GEOMAlgo_KindOfShape aKSE;//, aKSE; // GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); - // + // aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY); aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); aNbE=aInfo.NbSubShapes(TopAbs_EDGE); @@ -557,7 +557,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, //======================================================================= void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, const gp_Cylinder& aCyl) - + { Standard_Integer aNbV, aNbE, aNbCE, aNbSE; Standard_Real aT0, aT1, aHeight; @@ -627,130 +627,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, //function : FillDetails //purpose : //======================================================================= -void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, - const gp_Cone& aCone) -{ - Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i; - Standard_Real aR[3], aHeight, aRmin, aRmax; - gp_Pnt aPC[3], aPD, aPc, aPX[3]; - TopoDS_Vertex aVD; - TopoDS_Edge aE; - TopoDS_Iterator aIt; - TopExp_Explorer aExp; - TopTools_MapOfShape aM; - GEOMAlgo_KindOfShape aKSE; - GEOMAlgo_KindOfName aKNE; - GEOMAlgo_KindOfClosed aKCE; - // - GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); - // - aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY); - // - aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); - aNbE=aInfo.NbSubShapes(TopAbs_EDGE); - if (aNbV==2 && aNbE==3) { - i=0; - aNbCE=0; - aNbSE=0; - aNbDE=0; - aExp.Init(aF, TopAbs_EDGE); - for (; aExp.More(); aExp.Next()) { - aE=TopoDS::Edge(aExp.Current()); - if(aM.Add(aE)) { - const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE); - aKNE=aInfoE.KindOfName(); - aKCE=aInfoE.KindOfClosed(); - aKSE=aInfoE.KindOfShape(); - if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) { - aPC[i]=aInfoE.Location(); - aR[i]=aInfoE.Radius1(); - // - aIt.Initialize(aE); - if (aIt.More()) { - aVD=*((TopoDS_Vertex*)&aIt.Value()); - } - aPX[i]=BRep_Tool::Pnt(aVD); - // - ++i; - ++aNbCE; - } - else if (aKNE==GEOMAlgo_KN_SEGMENT) { - if (BRep_Tool::IsClosed(aE, aF)) { - ++aNbSE; - } - } - else if (aKSE==GEOMAlgo_KS_DEGENERATED) { - aIt.Initialize(aE); - if (aIt.More()) { - aVD=*((TopoDS_Vertex*)&aIt.Value()); - } - // - aPD=BRep_Tool::Pnt(aVD); - // - ++aNbDE; - } - } - } - // - if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) { - if (aNbDE==1) { - aPC[1]=aPD; - aR[1]=0.; - } - // - aHeight=aPC[0].Distance(aPC[1]); - // - - gp_Ax2 aAx2new; - // - if (aR[0]>aR[1]) { - aRmin=aR[1]; - aRmax=aR[0]; - aPc=aPC[0]; - gp_Vec aVz(aPC[0], aPC[1]); - gp_Vec aVx(aPC[0], aPX[0]); - gp_Dir aDz(aVz); - gp_Dir aDx(aVx); - gp_Ax2 aAx2(aPc, aDz, aDx); - aAx2new=aAx2; - } - else { - aRmin=aR[0]; - aRmax=aR[1]; - aPc=aPC[1]; - gp_Vec aVz(aPC[1], aPC[0]); - gp_Vec aVx(aPC[1], aPX[1]); - gp_Dir aDz(aVz); - gp_Dir aDx(aVx); - gp_Ax2 aAx2(aPc, aDz, aDx); - aAx2new=aAx2; - } - // - gp_Ax3 aAx3(aAx2new); - aInfo.SetLocation(aPc); - aInfo.SetPosition(aAx3); - aInfo.SetRadius1(aRmax); - aInfo.SetRadius2(aRmin); - aInfo.SetHeight(aHeight); - // - aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED); - return; - }//if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) { - }//if (aNbV==2 && aNbE==3) { - // - aInfo.SetRadius1 (aCone.RefRadius()); - // - aRmin=0.; // ZZ - aInfo.SetRadius2(aRmin); -} -//======================================================================= -//function : FillDetails -//purpose : -//======================================================================= void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, const gp_Torus& ) { - + Standard_Integer aNbV, aNbE, aNbSE; TopoDS_Edge aE; TopExp_Explorer aExp; @@ -764,10 +644,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, if (aKS!=GEOMAlgo_KS_TORUS) { return; } - + aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); - aNbE=aInfo.NbSubShapes(TopAbs_EDGE); - + aNbE=aInfo.NbSubShapes(TopAbs_EDGE); + if (aNbV==1 && aNbE==2) { aNbSE=0; aExp.Init(aF, TopAbs_EDGE); diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index f345d2d89..0b0cfe95f 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -22,7 +22,10 @@ // File : GeometryGUI.cxx // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -#include // E.A. must be included before Python.h to fix compilation on windows +#include + +#include // E.A. must be included before Python.h to fix compilation on windows + #ifdef HAVE_FINITE #undef HAVE_FINITE // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined #endif @@ -914,9 +917,10 @@ void GeometryGUI::OnMousePress( SUIT_ViewWindow* w, QMouseEvent* e ) //======================================================================= // function : createGeomAction // purpose : +// \param inModuleActionID is passed further without modifications. It is required by SUIT_ShortcutMgr. //======================================================================= void GeometryGUI::createGeomAction( const int id, const QString& label, const QString& icolabel, - const int accel, const bool toggle, const QString& shortcutAction ) + const int accel, const bool toggle, const QString& inModuleActionID ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); QPixmap icon = icolabel.isEmpty() ? resMgr->loadPixmap( "GEOM", tr( (QString( "ICO_" )+label).toLatin1().constData() ), false ) @@ -930,7 +934,18 @@ void GeometryGUI::createGeomAction( const int id, const QString& label, const QS application()->desktop(), toggle, this, SLOT( OnGUIEvent() ), - shortcutAction ); + inModuleActionID ); +} + +//======================================================================= +// function : createGeomAction +// purpose : +// Generates in module action automatically. +//======================================================================= +void GeometryGUI::createGeomAction( const int id, const QString& label, const QString& icolabel, + const int accel, const bool toggle) +{ + createGeomAction( id, label, icolabel, accel, toggle, QString( "STB_%1" ).arg( label ) ); } //======================================================================= @@ -1192,15 +1207,15 @@ void GeometryGUI::initialize( CAM_Application* app ) // Create actions for increase/decrease transparency shortcuts createGeomAction( GEOMOp::OpIncrTransparency, "", "", 0, false, - "Geometry:Increase transparency"); + "Transparency/Increase"); createGeomAction( GEOMOp::OpDecrTransparency, "", "", 0, false, - "Geometry:Decrease transparency"); + "Transparency/Decrease"); // Create actions for increase/decrease number of isolines createGeomAction( GEOMOp::OpIncrNbIsos, "", "", 0, false, - "Geometry:Increase number of isolines"); + "Isolines/Increase number"); createGeomAction( GEOMOp::OpDecrNbIsos, "", "", 0, false, - "Geometry:Decrease number of isolines"); + "Isolines/Decrease number"); //createGeomAction( GEOMOp::OpPipeTShape, "PIPETSHAPE" ); //createGeomAction( GEOMOp::OpDividedDisk, "DIVIDEDDISK" ); @@ -1450,7 +1465,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpCurve, basicTbId ); createTool( GEOMOp::OpVector, basicTbId ); createTool( GEOMOp::Op2dSketcher, basicTbId ); //rnc - createTool( GEOMOp::Op2dPolylineEditor, basicTbId ); + createTool( GEOMOp::Op2dPolylineEditor, basicTbId ); createTool( GEOMOp::Op3dSketcher, basicTbId ); //rnc createTool( GEOMOp::OpIsoline, basicTbId ); createTool( GEOMOp::OpSurfaceFromFace, basicTbId ); @@ -1821,7 +1836,7 @@ void GeometryGUI::addPluginActions() QString actionTool = stools.last(); actionTool = actionTool.toUpper().prepend( "TOP_" ); stools.removeLast(); - + QString actionStat = adata.statusText.c_str(); actionStat = actionStat.toUpper().prepend( "STB_" ); @@ -1830,12 +1845,13 @@ void GeometryGUI::addPluginActions() icon, tr( actionName.toLatin1().constData() ), tr( actionStat.toLatin1().constData() ), - QKeySequence( tr( adata.accel.c_str() ) ), + QKeySequence( tr( adata.accel.c_str() ) ), // Applied, if does not conflict with shortcuts in SUIT_ShortcutMgr. application()->desktop(), false /*toggle*/, this, SLOT( OnGUIEvent() ), - QString() /*shortcutAction*/ ); - + QString::fromStdString(pdata.name + "/" + adata.label) + ); + int menuId = -1; foreach ( QString subMenu, smenus ) { QStringList subMenuList = subMenu.split( ":" ); @@ -1844,7 +1860,7 @@ void GeometryGUI::addPluginActions() menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup ); } createMenu( id, menuId, -1 ); - + if ( !stools.isEmpty() ) { QString subTool = stools[0]; subTool = subTool.toUpper().prepend( "TOOL_" ); @@ -1855,7 +1871,7 @@ void GeometryGUI::addPluginActions() // add action id to map PluginAction anAction( pdata.clientLib.c_str(), adata.label.c_str() ); myPluginActions[id] = anAction; - + id++; } } @@ -1874,7 +1890,7 @@ namespace bool GeometryGUI::activateModule( SUIT_Study* study ) { // Fill in: Help Panel - SalomeApp_Application* app = dynamic_cast( application() ); + SalomeApp_Application* app = dynamic_cast( application() ); app->infoPanel()->setTitle(tr("INFO_WELCOME_TO_GEOM")); int gb = app->infoPanel()->addGroup(tr("INFO_GRP_CREATE_MODEL")); @@ -2247,7 +2263,7 @@ void GeometryGUI::onAutoBringToFront() bool isAutoBringToFront = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front", "false" ); if( !isAutoBringToFront ) return; - + SUIT_ViewWindow* SUIT_window = application()->desktop()->activeWindow(); if ( !SUIT_window || SUIT_window->getViewManager()->getType() != OCCViewer_Viewer::Type() ) return; @@ -2256,12 +2272,12 @@ void GeometryGUI::onAutoBringToFront() if (!appStudy) return; GEOM_Displayer displayer; - + SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; - + int aMgrId = dynamic_cast< SUIT_ViewModel* >( window )->getViewManager()->getGlobalId(); - + SALOME_ListIO selected; getApp()->selectionMgr()->selectedObjects( selected ); if (!myTopLevelIOList.IsEmpty()) @@ -2279,19 +2295,19 @@ void GeometryGUI::onAutoBringToFront() if (!isSelected && appStudy->findObjectByEntry(io->getEntry())) { appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), false ); - if ( window->isVisible( io ) ) displayer.Redisplay( io, false ); + if ( window->isVisible( io ) ) displayer.Redisplay( io, false ); } } } - + myTopLevelIOList.Assign(selected); for( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), true ); - if ( window->isVisible( io ) ) displayer.Redisplay( io, false ); + if ( window->isVisible( io ) ) displayer.Redisplay( io, false ); } - + displayer.UpdateViewer(); GeometryGUI::Modified(); } @@ -2499,7 +2515,7 @@ void GeometryGUI::createPreferences() addPreference( tr( "PREF_DIMENSIONS_COLOR" ), aDimGroupId, LightApp_Preferences::Color, "Geometry", "dimensions_color" ); - int aDimLineWidthId = addPreference( tr( "PREF_DIMENSIONS_LINE_WIDTH" ), aDimGroupId, + int aDimLineWidthId = addPreference( tr( "PREF_DIMENSIONS_LINE_WIDTH" ), aDimGroupId, LightApp_Preferences::IntSpin, "Geometry", "dimensions_line_width" ); setPreferenceProperty( aDimLineWidthId, "min", 1 ); @@ -2518,7 +2534,7 @@ void GeometryGUI::createPreferences() // add enginier font into combobox /*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile ); Handle(Font_SystemFont) sf = new Font_SystemFont( TCollection_AsciiString("Y14.5M-2009") ); - sf->SetFontPath( Font_FA_Regular, + sf->SetFontPath( Font_FA_Regular, TCollection_AsciiString( aFontFile.toLatin1().data() ) ); // register font in OCC font manager fmgr->RegisterFont( sf, Standard_False ); @@ -2584,7 +2600,7 @@ void GeometryGUI::createPreferences() addPreference( tr( "PREF_SHAPE_ANNOTATIONS_FONT_COLOR" ), aShapeAnnGroupId, LightApp_Preferences::Color, "Geometry", "shape_annotation_font_color" ); addPreference( tr( "PREF_SHAPE_ANNOTATIONS_LINE_COLOR" ), aShapeAnnGroupId, LightApp_Preferences::Color, "Geometry", "shape_annotation_line_color" ); - const int aShapeAnnFont = + const int aShapeAnnFont = addPreference( tr( "PREF_SHAPE_ANNOTATIONS_FONT" ), aShapeAnnGroupId, LightApp_Preferences::Font, "Geometry", "shape_annotation_font" ); int aShapeAnnFontFeatures = QtxFontEdit::Family | QtxFontEdit::Size | QtxFontEdit::Bold | QtxFontEdit::Italic; @@ -2592,7 +2608,7 @@ void GeometryGUI::createPreferences() setPreferenceProperty( aShapeAnnFont, "mode", QtxFontEdit::Custom ); setPreferenceProperty( aShapeAnnFont, "fonts", anOCCFonts ); - const int aShapeAnnLineWidth = + const int aShapeAnnLineWidth = addPreference( tr( "PREF_SHAPE_ANNOTATIONS_LINE_WIDTH" ), aShapeAnnGroupId, LightApp_Preferences::IntSpin, "Geometry", "shape_annotation_line_width" ); setPreferenceProperty( aShapeAnnLineWidth, "min", 1 ); @@ -3072,7 +3088,7 @@ void GeometryGUI::storeVisualParameters (int savePoint) param = occParam + GEOM::propertyName( GEOM::Color ); ip->setParameter(entry, param.toStdString(), val.join( GEOM::subSectionSeparator()).toStdString()); } - + if (aProps.contains(GEOM::propertyName( GEOM::Texture ))) { param = occParam + GEOM::propertyName( GEOM::Texture ); ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Texture )).toString().toStdString()); @@ -3232,7 +3248,7 @@ void GeometryGUI::restoreVisualParameters (int savePoint) for (; namesIt != paramNames.end(); ++namesIt, ++valuesIt) { - // visual parameters are stored in strings as follows: + // visual parameters are stored in strings as follows: // 1) ViewerType_ViewIndex_ParamName // 2) ViewerType_ParamName (shared for GEOM module) // '_' is used as separator and should not be used in viewer type or parameter names. @@ -3636,7 +3652,7 @@ void GeometryGUI::updateMaterials() \brief Check if the module allows "drag" operation of its objects. Overloaded from LightApp_Module class. - + This function is a part of the general drag-n-drop mechanism. The goal of this function is to check data object passed as a parameter and decide if it can be dragged or no. @@ -3704,13 +3720,13 @@ bool GeometryGUI::isDropAccepted( const SUIT_DataObject* where ) const /*! \brief Complete drag-n-drop operation. - + Overloaded from LightApp_Module class. This function is a part of the general drag-n-drop mechanism. Its goal is to handle dropping of the objects being dragged according to the chosen operation (move). The dropping is performed in the - context of the parent data object \a where and the \a row (position in the + context of the parent data object \a where and the \a row (position in the children index) at which the data should be dropped. If \a row is equal to -1, this means that objects are added to the end of the children list. @@ -3753,7 +3769,7 @@ void GeometryGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* wher _PTR(SObject) sobj = dataObj->object(); // check that dropped object is not a parent of target object if ( parentIDs.contains( sobj->GetID().c_str() ) ) { - return; // it's not allowed to move node into it's child + return; // it's not allowed to move node into it's child } objects[i] = _CAST(SObject, sobj)->GetSObject(); count++; diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 65e44c08b..7b39b36df 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -150,7 +150,7 @@ public: virtual bool isDraggable( const SUIT_DataObject* what ) const; virtual bool isDropAccepted( const SUIT_DataObject* where ) const; - virtual void dropObjects( const DataObjectList& what, + virtual void dropObjects( const DataObjectList& what, SUIT_DataObject* where, const int row, Qt::DropAction action ); @@ -195,10 +195,14 @@ protected: private: GEOMGUI* getLibrary( const QString& libraryName ); GEOMPluginGUI* getPluginLibrary( const QString& libraryName ); + void createGeomAction( const int id, const QString& po_id, + const QString& icon_id, + const int key, const bool toggle, + const QString& shortcutAction); void createGeomAction( const int id, const QString& po_id, const QString& icon_id = QString(""), - const int key = 0, const bool toggle = false, - const QString& shortcutAction = QString() ); + const int key = 0, const bool toggle = false); + void createPopupItem( const int, const QString& clients, const QString& types, const bool isSingle = false, const int isVisible = -1, const bool isExpandAll = false, const bool isOCC = false, @@ -210,7 +214,7 @@ private: public: static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!! -private: +private: typedef QMap GUIMap; @@ -231,10 +235,10 @@ private: int myLocalSelectionMode; //Select Only GEOMGUI_CreationInfoWdg* myCreationInfoWdg; - + GEOMGUI_TextTreeWdg* myTextTreeWdg; GEOMGUI_AnnotationMgr* myAnnotationMgr; - + SALOME_ListIO myTopLevelIOList; friend class DisplayGUI; diff --git a/src/GEOMImpl/CMakeLists.txt b/src/GEOMImpl/CMakeLists.txt index a6615ea7d..64228aa7c 100644 --- a/src/GEOMImpl/CMakeLists.txt +++ b/src/GEOMImpl/CMakeLists.txt @@ -25,6 +25,7 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${KERNEL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/ShHealOper ${PROJECT_SOURCE_DIR}/src/GEOM ${PROJECT_SOURCE_DIR}/src/BlockFix @@ -187,6 +188,8 @@ SET(GEOMImpl_HEADERS GEOMImpl_Types.hxx GEOM_GEOMImpl.hxx GEOMImpl_ICanonicalRecognition.hxx + GEOMImpl_WrappingDriver.hxx + GEOMImpl_IWrap.hxx ) # --- sources --- @@ -266,6 +269,7 @@ SET(GEOMImpl_SOURCES GEOMImpl_ShapeProximityDriver.cxx GEOMImpl_FieldDriver.cxx GEOMImpl_ICanonicalRecognition.cxx + GEOMImpl_WrappingDriver.cxx ) # --- rules --- diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index 3f6ae71c4..7a26f1fb9 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -85,6 +85,7 @@ #include #include #include +#include //============================================================================= /*! @@ -171,6 +172,9 @@ GEOMImpl_Gen::GEOMImpl_Gen() // Field TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FieldDriver::GetID(), new GEOMImpl_FieldDriver()); + // Wrapping + TFunction_DriverTable::Get()->AddDriver(GEOMImpl_WrappingDriver::GetID(), new GEOMImpl_WrappingDriver()); + /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/ SetEngine(this); diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index fef00a9ad..eff9b9233 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -24,7 +24,8 @@ // E.A. : On windows with python 2.6, there is a conflict // E.A. : between pymath.h and Standard_math.h which define // E.A. : some same symbols : acosh, asinh, ... -#include +#include +#include #include #endif diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index ac9b0dfe6..27c0cc42e 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -109,7 +109,7 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { // This function doesn't do any healing. // The only goal is to provide Python dump functionality for // algorithms entirely implemented in Python. - void FuncToPythonDump( + Standard_EXPORT void FuncToPythonDump( Handle(GEOM_Object) theObject, Handle(GEOM_Object) result, const char* imports, diff --git a/src/GEOMImpl/GEOMImpl_IShapes.hxx b/src/GEOMImpl/GEOMImpl_IShapes.hxx index d58e82dbf..60d7e8750 100644 --- a/src/GEOMImpl/GEOMImpl_IShapes.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapes.hxx @@ -41,6 +41,7 @@ class GEOMImpl_IShapes SHAPE_ARG_INDICES = 5, // for Sub-shape SHAPE_ARG_TOLERANCE = 6, // linear tolerance (for Wire, Edge) SHAPE_ARG_ANGLE_TOL = 7, // angular tolerance (for Edge) + SHAPE_ARG_WIRE_MODE = 8, // gaps closing mode (for Wire) }; GEOMImpl_IShapes(Handle(GEOM_Function) theFunction): _func(theFunction) {} @@ -77,6 +78,11 @@ class GEOMImpl_IShapes Standard_Real GetTolerance() { return _func->GetReal(SHAPE_ARG_TOLERANCE); } + void SetWireMode(const Standard_Integer theValue) + { _func->SetInteger(SHAPE_ARG_WIRE_MODE, theValue); } + + Standard_Integer GetWireMode() { return _func->GetInteger(SHAPE_ARG_WIRE_MODE); } + void SetAngularTolerance(const Standard_Real theValue) { _func->SetReal(SHAPE_ARG_ANGLE_TOL, theValue); } diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index ce32259fb..edc8d56fd 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -35,6 +35,7 @@ #include "GEOMImpl_ShapeDriver.hxx" #include "GEOMImpl_GlueDriver.hxx" #include "GEOMImpl_FillingDriver.hxx" +#include "GEOMImpl_WrappingDriver.hxx" #include "GEOMImpl_IExtract.hxx" #include "GEOMImpl_IVector.hxx" @@ -42,6 +43,7 @@ #include "GEOMImpl_IShapeExtend.hxx" #include "GEOMImpl_IGlue.hxx" #include "GEOMImpl_IFilling.hxx" +#include "GEOMImpl_IWrap.hxx" #include "GEOMImpl_Block6Explorer.hxx" #include "GEOMImpl_IHealingOperations.hxx" @@ -377,7 +379,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeWire //============================================================================= Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire (std::list theShapes, - const Standard_Real theTolerance) + const Standard_Real theTolerance, + const GEOMImpl_WireBuildMode theMode) { SetErrorCode(KO); @@ -394,6 +397,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire GEOMImpl_IShapes aCI (aFunction); aCI.SetTolerance(theTolerance); + aCI.SetWireMode(theMode); Handle(TColStd_HSequenceOfTransient) aShapesSeq = new TColStd_HSequenceOfTransient; @@ -424,7 +428,19 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire //Make a Python command GEOM::TPythonDump pd (aFunction); - pd << aWire << " = geompy.MakeWire(["; + pd << aWire; + switch (theMode) { + case GEOMImpl_WBM_FixTolerance: + pd << " = geompy.MakeWire(["; + break; + case GEOMImpl_WBM_Approximation: + pd << " = geompy.MakeWireWithMode(["; + break; + case GEOMImpl_WBM_KeepCurveType: + pd << " = geompy.MakeWireConstCurveType(["; + break; + default: ; + } // Shapes it = theShapes.begin(); @@ -434,7 +450,11 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire pd << ", " << (*it++); } } - pd << "], " << theTolerance << ")"; + pd << "], " << theTolerance; + if (theMode == GEOMImpl_WBM_Approximation) { + pd << ", GEOM.WBM_Approximation"; + } + pd << ")"; SetErrorCode(OK); return aWire; @@ -648,6 +668,99 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceFromSurface return aShape; } +//============================================================================= +/*! + * MakeWrappedFace + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWrappedFace + (std::list theEdges, + std::list theVertices, + const Standard_Real theTolerance) +{ + SetErrorCode(KO); + //Add a new object + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE); + + //Add a new function + Handle(GEOM_Function) aFunction = + aShape->AddFunction(GEOMImpl_WrappingDriver::GetID(), WRAPPING_FACE); + if (aFunction.IsNull()) return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_WrappingDriver::GetID()) return NULL; + + GEOMImpl_IWrap aCI (aFunction); + aCI.SetTolerance(theTolerance); + + // Edges + Handle(TColStd_HSequenceOfTransient) anEdgesSeq = new TColStd_HSequenceOfTransient; + std::list::iterator it = theEdges.begin(); + for (; it != theEdges.end(); it++) { + Handle(GEOM_Object) anEdge = (*it); + if ( anEdge.IsNull() || anEdge->GetValue().ShapeType() != TopAbs_EDGE ) { + SetErrorCode("NULL argument edge for the face construction"); + return NULL; + } + Handle(GEOM_Function) aRefSh = anEdge->GetLastFunction(); + anEdgesSeq->Append(aRefSh); + } + aCI.SetEdges(anEdgesSeq); + + // Vertices + Handle(TColStd_HSequenceOfTransient) aVerticesSeq = new TColStd_HSequenceOfTransient; + it = theVertices.begin(); + for (; it != theVertices.end(); it++) { + Handle(GEOM_Object) aVertex = (*it); + if ( aVertex.IsNull() || aVertex->GetValue().ShapeType() != TopAbs_VERTEX ) { + SetErrorCode("NULL argument vertex for the face construction"); + return NULL; + } + Handle(GEOM_Function) aRefSh = aVertex->GetLastFunction(); + aVerticesSeq->Append(aRefSh); + } + aCI.SetVertices(aVerticesSeq); + + //Compute the face + try { + OCC_CATCH_SIGNALS; + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Wrap driver failed"); + return NULL; + } + } + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); + return NULL; + } + + //Make a Python command + GEOM::TPythonDump pd (aFunction); + pd << aShape << " = geompy.MakeWrappedFace(["; + + // Edges + it = theEdges.begin(); + if (it != theEdges.end()) { + pd << (*it++); + while (it != theEdges.end()) { + pd << ", " << (*it++); + } + } + pd << "], ["; + // Vertices + it = theVertices.begin(); + if (it != theVertices.end()) { + pd << (*it++); + while (it != theVertices.end()) { + pd << ", " << (*it++); + } + } + pd << "], " << theTolerance << ")"; + SetErrorCode(OK); + + return aShape; +} + //============================================================================= /*! * MakeFaceWithConstraints diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index 0cb04e069..dc352ba58 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -48,6 +48,12 @@ class GEOM_Engine; class GEOM_Object; class TopoDS_Shape; +enum GEOMImpl_WireBuildMode { + GEOMImpl_WBM_FixTolerance = 1, + GEOMImpl_WBM_Approximation = 2, + GEOMImpl_WBM_KeepCurveType = 3 +}; + class GEOMImpl_IShapesOperations : public GEOM_IOperations { public: @@ -94,7 +100,8 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations const Standard_Real theAngularTolerance); Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list theEdgesAndWires, - const Standard_Real theTolerance); + const Standard_Real theTolerance, + const GEOMImpl_WireBuildMode theMode = GEOMImpl_WBM_FixTolerance); Standard_EXPORT Handle(GEOM_Object) MakeFace (Handle(GEOM_Object) theWire, const bool isPlanarWanted); @@ -104,6 +111,10 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT Handle(GEOM_Object) MakeFaceFromSurface (Handle(GEOM_Object) theFace, Handle(GEOM_Object) theWire); + + Standard_EXPORT Handle(GEOM_Object) MakeWrappedFace(std::list theEdges, + std::list theVertices, + const Standard_Real theTolerance); Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list theConstraints); diff --git a/src/GEOMImpl/GEOMImpl_ITestOperations.cxx b/src/GEOMImpl/GEOMImpl_ITestOperations.cxx index db1ac798f..629233356 100644 --- a/src/GEOMImpl/GEOMImpl_ITestOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITestOperations.cxx @@ -22,11 +22,10 @@ #include -#include +#include + #include -#include -#include -#include + #include #ifndef MAX2 @@ -83,25 +82,22 @@ bool GEOMImpl_ITestOperations::Tesselate(Handle(GEOM_Object) theShape, // reset error code SetErrorCode(KO); + // create a copy of the source shape TopoDS_Shape aShape = BRepBuilderAPI_Copy(theShape->GetValue()).Shape(); + // use default deflection if necessary if (theLinearDeflection <= 0) theLinearDeflection = 0.001; - // compute absolute deflection if necessary: 0.001 - if (theIsRelative) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - Bnd_Box bndBox; - BRepBndLib::Add(aShape, bndBox); - bndBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - theLinearDeflection = MAX3(aXmax-aXmin, aYmax-aYmin, aZmax-aZmin) * theLinearDeflection * 4; - } + // use default deviation angle if necessary: 20 degrees if (theAngularDeflection <= 0) theAngularDeflection = 20. * M_PI / 180.; + // compute triangulation - BRepTools::Clean(aShape); - BRepMesh_IncrementalMesh aMesh(aShape, theLinearDeflection, Standard_False, theAngularDeflection); + GEOMUtils::MeshShape(aShape, theLinearDeflection, /*theForced*/ true, + theAngularDeflection, theIsRelative); + // set OK status and return SetErrorCode(OK); return true; diff --git a/src/GEOMImpl/GEOMImpl_IWrap.hxx b/src/GEOMImpl/GEOMImpl_IWrap.hxx new file mode 100644 index 000000000..24a230324 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IWrap.hxx @@ -0,0 +1,58 @@ +// 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 +// +// 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 +// + +//NOTE: This is an interface to a function for the Box creation. +// +#include "GEOM_Function.hxx" + +class GEOMImpl_IWrap +{ + public: + + enum { + WRAP_ARG_EDGES = 1, // list of edges + WRAP_ARG_VERTICES = 2, // list of vertices + WRAP_TOLER = 3, // tolerance + }; + + GEOMImpl_IWrap(Handle(GEOM_Function) theFunction): _func(theFunction) {} + + void SetEdges(const Handle(TColStd_HSequenceOfTransient)& theShapes) + { _func->SetReferenceList(WRAP_ARG_EDGES, theShapes); } + + Handle(TColStd_HSequenceOfTransient) GetEdges() + { return _func->GetReferenceList(WRAP_ARG_EDGES); } + + void SetVertices(const Handle(TColStd_HSequenceOfTransient)& theShapes) + { _func->SetReferenceList(WRAP_ARG_VERTICES, theShapes); } + + Handle(TColStd_HSequenceOfTransient) GetVertices() + { return _func->GetReferenceList(WRAP_ARG_VERTICES); } + + void SetTolerance(double theTol) { _func->SetReal(WRAP_TOLER, theTol); } + + double GetTolerance() { return _func->GetReal(WRAP_TOLER); } + + private: + + Handle(GEOM_Function) _func; +}; \ No newline at end of file diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 8f1f24850..0923bd112 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -22,6 +22,8 @@ #include +#include + #include #include #include @@ -436,7 +438,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(Handle(TFunction_Logbook)& log) c if (aTolerance < Precision::Confusion()) aTolerance = Precision::Confusion(); - aShape = MakeWireFromEdges(aShapes, aTolerance); + Standard_Integer aMode = aCI.GetWireMode(); + + aShape = MakeWireFromEdges(aShapes, aTolerance, (GEOMImpl_WireBuildMode)aMode); } else if (aType == FACE_WIRE) { // result may be a face or a compound of faces @@ -1088,7 +1092,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(Handle(TFunction_Logbook)& log) c } TopoDS_Wire GEOMImpl_ShapeDriver::MakeWireFromEdges(const Handle(TColStd_HSequenceOfTransient)& theEdgesFuncs, - const Standard_Real theTolerance) + const Standard_Real theTolerance, + const GEOMImpl_WireBuildMode theMode) { BRep_Builder B; @@ -1136,14 +1141,30 @@ TopoDS_Wire GEOMImpl_ShapeDriver::MakeWireFromEdges(const Handle(TColStd_HSequen } aFW->ClosedWireMode() = isClosed; aFW->FixConnected(theTolerance); + if (aFW->StatusConnected(ShapeExtend_FAIL)) { Standard_ConstructionError::Raise("Wire construction failed: cannot build connected wire"); } // IMP 0019766 - if (aFW->StatusConnected(ShapeExtend_DONE3)) { - // Confused with but not Analyzer.Precision(), set the same - aFW->SetPrecision(theTolerance); // bos #33377, prevent conversion of initial curves to BSplines + if (theMode == GEOMImpl_WBM_KeepCurveType) { +#if OCC_VERSION_LARGE > 0x07050305 + aFW->FixCurves(); + if (aFW->StatusCurves(ShapeExtend_FAIL1)) { + Standard_ConstructionError::Raise("Wire construction failed: cannot update Bezier or B-Spline curve ends, because they don't correspond to the first and last poles"); + } + if (aFW->StatusCurves(ShapeExtend_FAIL)) { + Standard_ConstructionError::Raise("Wire construction failed: cannot rebuild curves through new points"); + } +#else + Standard_NotImplemented::Raise("Wire construction failed: option KeepCurveType is not supported by current OCCT version: please, use OCCT 7.5.3p6 or newer."); +#endif // OCC_VERSION_LARGE > 0x07050305 + } + else if (aFW->StatusConnected(ShapeExtend_DONE3)) { + if (theMode != GEOMImpl_WBM_Approximation) { + // Confused with but not Analyzer.Precision(), set the same + aFW->SetPrecision(theTolerance); + } aFW->FixGapsByRangesMode() = Standard_True; if (aFW->FixGaps3d()) { Handle(ShapeExtend_WireData) sbwd = aFW->WireData(); @@ -1906,6 +1927,7 @@ GetCreationInformation(std::string& theOperationName, theOperationName = "WIRE"; AddParam( theParams, "Wires/edges", aCI.GetShapes() ); AddParam( theParams, "Tolerance", aCI.GetTolerance() ); + AddParam( theParams, "Mode", aCI.GetWireMode() ); break; case FACE_WIRE: theOperationName = "FACE"; diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx index 1e3328781..4336142fa 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx @@ -31,6 +31,8 @@ #include #include +#include "GEOMImpl_IShapesOperations.hxx" + #include class TopoDS_Face; @@ -56,7 +58,8 @@ public: Standard_EXPORT static TopoDS_Wire MakeWireFromEdges (const Handle(TColStd_HSequenceOfTransient)& theEdgesFuncs, - const Standard_Real theTolerance); + const Standard_Real theTolerance, + const GEOMImpl_WireBuildMode theMode = GEOMImpl_WBM_FixTolerance); Standard_EXPORT virtual bool GetCreationInformation(std::string& theOperationName, std::vector& params); diff --git a/src/GEOMImpl/GEOMImpl_ShapeProximityDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeProximityDriver.cxx index 23404069b..df823e314 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeProximityDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeProximityDriver.cxx @@ -21,6 +21,8 @@ #include #include +#include + #include #include #include @@ -37,28 +39,6 @@ #include namespace { - static void tessellateShape(const TopoDS_Shape& theShape) - { - Standard_Boolean isTessellate = Standard_False; - TopLoc_Location aLoc; - for (TopExp_Explorer anExp(theShape, TopAbs_FACE); anExp.More() && !isTessellate; anExp.Next()) - { - Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(TopoDS::Face(anExp.Value()), aLoc); - isTessellate = aTria.IsNull(); - } - for (TopExp_Explorer anExp(theShape, TopAbs_EDGE); anExp.More() && !isTessellate; anExp.Next()) - { - Handle(Poly_Polygon3D) aPoly = BRep_Tool::Polygon3D(TopoDS::Edge(anExp.Value()), aLoc); - isTessellate = aPoly.IsNull(); - } - - if (isTessellate) - { - BRepMesh_IncrementalMesh aMesher(theShape, 0.1); - Standard_ProgramError_Raise_if(!aMesher.IsDone(), "Meshing failed"); - } - } - static Standard_Real paramOnCurve(const BRepAdaptor_Curve& theCurve, const gp_Pnt& thePoint, const Standard_Real theTol) { Extrema_ExtPC aParamSearch(thePoint, theCurve, theCurve.FirstParameter(), theCurve.LastParameter()); @@ -293,8 +273,8 @@ Standard_Integer GEOMImpl_ShapeProximityDriver::Execute(Handle(TFunction_Logbook if (aFunction->GetType() == PROXIMITY_COARSE) { // tessellate shapes if there is no mesh exists - tessellateShape(aShape1); - tessellateShape(aShape2); + GEOMUtils::MeshShape(aShape1, 0.1, /*theForced*/false, 0.5, /*isRelative*/false); + GEOMUtils::MeshShape(aShape2, 0.1, /*theForced*/false, 0.5, /*isRelative*/false); // compute proximity basing on the tessellation BRepExtrema_ShapeProximity aCalcProx; diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 04bea6ac1..9a0c75e65 100644 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -327,6 +327,8 @@ #define SOLID_FACES 19 #define EXTRACTION 20 +#define WRAPPING_FACE 1 + #define ARCHIMEDE_TYPE 1 // Shape Healing operators diff --git a/src/GEOMImpl/GEOMImpl_WrappingDriver.cxx b/src/GEOMImpl/GEOMImpl_WrappingDriver.cxx new file mode 100644 index 000000000..e89a3e62c --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_WrappingDriver.cxx @@ -0,0 +1,456 @@ +// 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 +// +// 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 +// + +// These GeomPlate_* headers must be included before Salome ones +// because of conflicting OK variable/constant between +// OCCT Plate_Plate.hxx and GEOM GEOM_IOperations.hxx +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#if OCC_VERSION_LARGE < 0x07070000 +#include +#else +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +//======================================================================= +// function : GetID +// purpose : +//======================================================================= +const Standard_GUID &GEOMImpl_WrappingDriver::GetID() +{ + static Standard_GUID aWrapDriver("FF1BBB71-729D-4E83-8232-78E74FC5637C"); + return aWrapDriver; +} + +//======================================================================= +// function : GEOMImpl_WrappingDriver +// purpose : +//======================================================================= +GEOMImpl_WrappingDriver::GEOMImpl_WrappingDriver() +{ +} + +//======================================================================= +// function : createPointsOnEdges +// purpose : create points on edges +//======================================================================= +static void createPointsOnEdges(const Handle(TColStd_HSequenceOfTransient) & theEdgesFuncs, + std::vector &thePoints) +{ + for (int i = 1; i <= theEdgesFuncs->Length(); i++) + { + Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(theEdgesFuncs->Value(i)); + TopoDS_Shape aShape_i = aRefShape->GetValue(); + if (aShape_i.IsNull()) + { + Standard_NullObject::Raise("Edge for face construction is null"); + } + TopExp_Explorer exp(aShape_i, TopAbs_EDGE); + for (; exp.More(); exp.Next()) + { + Standard_Real aFP, aLP, aP; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(exp.Current()), aFP, aLP); + if (!aCurve.IsNull()) + { + for (int aPar = 1; aPar <= 9; aPar++) + { + aP = aFP + (aLP - aFP) * (aPar * 0.1); + gp_Pnt aPnt = aCurve->Value(aP); + thePoints.push_back(aPnt); + } + } + } + } +} + +//================================================================================ +// function : maxDistanceToFace +// purpose : finds max distanse between points and a face +//================================================================================ +static Standard_Real maxDistanceToFace(const std::vector& thePoints, + const TopoDS_Face& theFace, + const Standard_Real theTolerance) +{ + Standard_Real U, V; + Standard_Real aMaxDist = 0.; + for(auto& aPnt : thePoints) + { + gp_Pnt aProj = GEOMUtils::ProjectPointOnFace(aPnt, theFace,U,V,theTolerance); + Standard_Real aDist = aProj.Distance(aPnt); + if(aDist > aMaxDist) + { + aMaxDist = aDist; + } + } + return aMaxDist; +} + +//================================================================================ +// function : divideSphericalShape +// purpose : divide spherical shape into two piece +// and choose that part that has the points +//================================================================================ +static void divideSphericalShape(TopoDS_Shape &theShape, + const TopoDS_Wire &theWire, + const std::vector &thePoints, + const Standard_Real theTolerance) +{ + TopExp_Explorer anExp(theShape, TopAbs_FACE); + const TopoDS_Face& aFace = TopoDS::Face(anExp.Current()); + TopoDS_Face aToolFace; + GEOMImpl_Block6Explorer::MakeFace(theWire, false, aToolFace); + if(!aToolFace.IsNull()) + { + //split sphere and choose right part + GEOMAlgo_Splitter PS; + PS.AddArgument(aFace); + PS.AddTool(aToolFace); + PS.SetLimit(TopAbs_FACE); + PS.Perform(); + TopoDS_Shape aResultShape = PS.Shape(); + if(!aResultShape.IsNull()) + { + anExp.Init(aResultShape, TopAbs_FACE); + for (; anExp.More(); anExp.Next()) + { + Standard_Real aDist = maxDistanceToFace(thePoints, TopoDS::Face(anExp.Current()), theTolerance); + if(aDist < theTolerance) + { + theShape = TopoDS::Face(anExp.Current()); + break; + } + } + } + } +} + +//================================================================================ +// function : makeFaceFromPointsAndWire +// purpose : Create face from set of points with the same approach as for +// geompy.makeSmoothingSurface. Cut resulting surface with a wire +//================================================================================ +static TopoDS_Shape makeFaceFromPointsAndWire(const TopoDS_Wire &theWire, + const std::vector &theAllPoints) +{ + int nbPoints = theAllPoints.size(); + Handle(TColgp_HArray1OfPnt) anArrayofPnt = new TColgp_HArray1OfPnt(1, nbPoints); + for (int i = 0; i < nbPoints; i++) { + gp_Pnt aP = theAllPoints[i]; + anArrayofPnt->SetValue(i+1, aP); + } + + // Try to build smoothing surface + GeomPlate_BuildAveragePlane gpbap(anArrayofPnt,anArrayofPnt->Length(),Precision::Confusion(),1,1); + Handle(Geom_Plane) plane(gpbap.Plane()); + + Standard_Real Umin, Umax, Vmin, Vmax; + gpbap.MinMaxBox(Umin,Umax,Vmin,Vmax); + + TopoDS_Face aInitShape; + BRepBuilderAPI_MakeFace mf(plane,Umin,Umax,Vmin,Vmax,Precision::Confusion()); + aInitShape = mf.Face(); + + GeomPlate_BuildPlateSurface aBuilder(3,10); + // ** Initialization of surface +#if OCC_VERSION_LARGE < 0x07070000 + Handle(BRepAdaptor_HSurface) HSI = new BRepAdaptor_HSurface(); + HSI->ChangeSurface().Initialize(aInitShape); + aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->ChangeSurface().Face())); +#else + Handle(BRepAdaptor_Surface) HSI = new BRepAdaptor_Surface(); + HSI->Initialize(aInitShape); + aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->Face()) ); +#endif + + Standard_Integer j, j1, j2; + j1 = anArrayofPnt->Lower(); + j2 = anArrayofPnt->Upper(); + for (j=j1; j<=j2 ; j++) + { + gp_Pnt aPnt = anArrayofPnt->Value(j); + Handle(GeomPlate_PointConstraint) PCont = new GeomPlate_PointConstraint(aPnt,0); + aBuilder.Add(PCont); + } + aBuilder.Perform(); + Handle(GeomPlate_Surface) gpPlate = aBuilder.Surface(); + if(gpPlate.IsNull()) + { + Standard_ConstructionError::Raise("Not possible to build a face with given input, GeomPlate_Surface failed"); + } + + Standard_Real seuil = Max(0.0001,10*aBuilder.G0Error()); + GeomPlate_MakeApprox Mapp(gpPlate,0.0001,2,8,seuil); + Handle(Geom_Surface) aSurf(Mapp.Surface()); + + //cut surface with a face + TopoDS_Shape aShape; + BRepBuilderAPI_MakeFace aMkFace(aSurf, theWire); + if (aMkFace.IsDone()) + { + aShape = aMkFace.Shape(); + } + + TopoDS_Face aFace = TopoDS::Face(aShape); + Handle(ShapeFix_Face) aFix = new ShapeFix_Face(aFace); + aFix->Perform(); + aFix->FixOrientation(); + aFace = aFix->Face(); + + return aFace; +} + +//======================================================================= +// function : Execute +// purpose : +//======================================================================= +Standard_Integer GEOMImpl_WrappingDriver::Execute(Handle(TFunction_Logbook) & log) const +{ + if (Label().IsNull()) + return 0; + Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); + + GEOMImpl_IWrap aCI(aFunction); + Standard_Integer aType = aFunction->GetType(); + + TopoDS_Shape aShape; + + if (aType == WRAPPING_FACE) + { + Handle(TColStd_HSequenceOfTransient) anEdges = aCI.GetEdges(); + Handle(TColStd_HSequenceOfTransient) aVertices = aCI.GetVertices(); + + int nbEdge = anEdges->Length(); + int nbVertices = aVertices->Length(); + + if (nbEdge < 1 || nbVertices < 1) + { + Standard_ConstructionError::Raise("No edges or vertices given"); + } + + Standard_Real aTolerance = aCI.GetTolerance(); + if (aTolerance < Precision::Confusion()) + aTolerance = Precision::Confusion(); + + std::vector anAllPoints, aPoints; + createPointsOnEdges(anEdges, anAllPoints); + for (int i = 1; i <= aVertices->Length(); i++) + { + Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aVertices->Value(i)); + TopoDS_Shape aShape_i = aRefShape->GetValue(); + if (aShape_i.IsNull()) + { + Standard_NullObject::Raise("Vertex for face construction is null"); + } + TopExp_Explorer exp (aShape_i, TopAbs_VERTEX); + for (; exp.More(); exp.Next()) + { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(exp.Current())); + anAllPoints.push_back(aP); + aPoints.push_back(aP); + } + } + + if(anAllPoints.size() == 0) + { + Standard_NullObject::Raise("Shape creation imposible, no valid objects were given"); + } + + //create wire from edges + TopoDS_Wire aWire = GEOMImpl_ShapeDriver::MakeWireFromEdges(anEdges, aTolerance); + if(aWire.IsNull()) + { + Standard_NullObject::Raise("Given edges does not create closed contour"); + } + + aShape = createWrappedFace(aWire, anAllPoints, aPoints, aTolerance); + } + + if (aShape.IsNull()) + return 0; + + aFunction->SetValue(aShape); + + log->SetTouched(Label()); + + return 1; +} + +//================================================================================ +/*! + * \brief Create wrapped face from vector of points and wire + */ +//================================================================================ +TopoDS_Shape GEOMImpl_WrappingDriver::createWrappedFace(const TopoDS_Wire &theWire, + const std::vector &theAllPoints, + const std::vector &thePoints, + const Standard_Real theTolerance) const +{ + TopoDS_Shape aShape; + + gp_Pnt aCenter(0,0,0); + Standard_Real aRadius = 100; + if(isSphere(theAllPoints, aCenter, aRadius, theTolerance)) + { + aShape = BRepPrimAPI_MakeSphere(aCenter, aRadius).Shape(); + divideSphericalShape(aShape, theWire, thePoints, theTolerance); + return aShape; + } + + aShape = makeFaceFromPointsAndWire(theWire, theAllPoints); + return aShape; +} + +//================================================================================ +/*! + * \brief Returns a name of creation operation and names and values of creation parameters + */ +//================================================================================ +Standard_Boolean GEOMImpl_WrappingDriver::isSphere(const std::vector& thePoints, + gp_Pnt& theCenter, + Standard_Real& theRadius, + const Standard_Real theTolerance)const +{ + int aNumPoints = thePoints.size(); + if(aNumPoints == 0) + { + return false; + } + + // Create coefficient matrix A and right-hand side vector f + Eigen::MatrixXd A(aNumPoints, 4); + Eigen::VectorXd f(aNumPoints); + + Standard_Real X(.0); + Standard_Real Y(.0); + Standard_Real Z(.0); + + for (int i = 0; i < aNumPoints; ++i) + { + X = thePoints[i].X(); + Y = thePoints[i].Y(); + Z = thePoints[i].Z(); + A(i, 0) = X * 2; + A(i, 1) = Y * 2; + A(i, 2) = Z * 2; + A(i, 3) = 1.0; + f(i) = X * X + Y * Y + Z * Z; + } + + // Solve linear equations to get coefficients + Eigen::VectorXd c = A.colPivHouseholderQr().solve(f); + + Standard_Real t = c[0] * c[0] + c[1] * c[1] + c[2] * c[2] + c[3]; + theRadius = std::sqrt(t); + theCenter.SetCoord(c[0], c[1], c[2]); + + //check that all points belong to the sphere within theTolerance + std::vector aDists; + for(const auto& aPnt : thePoints) + { + aDists.push_back(aPnt.Distance(theCenter)); + } + if (!aDists.empty()) + { + Standard_Real sumDistances = std::accumulate(aDists.begin(), aDists.end(), 0.0); + Standard_Real averageDistance = sumDistances / aDists.size(); + + if (std::fabs(averageDistance - theRadius) > theTolerance) { + return false; + } + } + + return true; +} + +//================================================================================ +/*! + * \brief Returns a name of creation operation and names and values of creation parameters + */ +//================================================================================ + +bool GEOMImpl_WrappingDriver:: + GetCreationInformation(std::string &theOperationName, + std::vector &theParams) +{ + if (Label().IsNull()) return 0; + Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label()); + + GEOMImpl_IWrap aCI( function ); + Standard_Integer aType = function->GetType(); + + theOperationName = "WRAPPEDFACE"; + + switch ( aType ) { + case WRAPPING_FACE: + AddParam(theParams, "Edges", aCI.GetEdges()); + AddParam(theParams, "Vertices", aCI.GetVertices()); + AddParam(theParams, "Tolerance", aCI.GetTolerance()); + break; + default: + return false; + } + + return true; +} + +IMPLEMENT_STANDARD_RTTIEXT(GEOMImpl_WrappingDriver, GEOM_BaseDriver) diff --git a/src/GEOMImpl/GEOMImpl_WrappingDriver.hxx b/src/GEOMImpl/GEOMImpl_WrappingDriver.hxx new file mode 100644 index 000000000..45324044d --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_WrappingDriver.hxx @@ -0,0 +1,68 @@ +// 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 +// +// 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 +// + +// File : GEOMImpl_WrappingDriver.hxx +// Module : GEOMImpl +// +#ifndef _GEOMImpl_WrappingDriver_HeaderFile +#define _GEOMImpl_WrappingDriver_HeaderFile + +#include + +class TopoDS_Wire; +class TopoDS_Face; +class TColgp_HArray1OfPnt; + +DEFINE_STANDARD_HANDLE( GEOMImpl_WrappingDriver, GEOM_BaseDriver ) + +class GEOMImpl_WrappingDriver : public GEOM_BaseDriver { + +public: + + Standard_EXPORT GEOMImpl_WrappingDriver(); + Standard_EXPORT ~GEOMImpl_WrappingDriver() {}; + + Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; + Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)&) const {} + Standard_EXPORT Standard_Boolean MustExecute(const Handle(TFunction_Logbook)&) const { return Standard_True; } + + Standard_EXPORT static const Standard_GUID& GetID(); + + Standard_EXPORT virtual + bool GetCreationInformation(std::string& theOperationName, + std::vector& params); + + DEFINE_STANDARD_RTTIEXT(GEOMImpl_WrappingDriver,GEOM_BaseDriver) + +private: + TopoDS_Shape createWrappedFace(const TopoDS_Wire& theWire, + const std::vector& theAllPoints, + const std::vector& thePoints, + const Standard_Real theTolerance)const; + + Standard_Boolean isSphere(const std::vector& thePoints, + gp_Pnt& theCenter, + Standard_Real& theRadius, + const Standard_Real theTolerance)const; +}; + +#endif \ No newline at end of file diff --git a/src/GEOMUtils/GEOMUtils.cxx b/src/GEOMUtils/GEOMUtils.cxx index f61f871e7..cb36716e4 100644 --- a/src/GEOMUtils/GEOMUtils.cxx +++ b/src/GEOMUtils/GEOMUtils.cxx @@ -93,6 +93,8 @@ #include #include +#include + #include #include #include @@ -677,56 +679,6 @@ void GEOMUtils::AddSimpleShapes (const TopoDS_Shape& theShape, TopTools_ListOfSh } } -//======================================================================= -//function : CheckTriangulation -//purpose : -//======================================================================= -bool GEOMUtils::CheckTriangulation (const TopoDS_Shape& aShape) -{ - bool isTriangulation = true; - - TopExp_Explorer exp (aShape, TopAbs_FACE); - if (exp.More()) - { - TopLoc_Location aTopLoc; - Handle(Poly_Triangulation) aTRF; - aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc); - if (aTRF.IsNull()) { - isTriangulation = false; - } - } - else // no faces, try edges - { - TopExp_Explorer expe (aShape, TopAbs_EDGE); - if (!expe.More()) { - return false; - } - TopLoc_Location aLoc; - Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc); - if (aPE.IsNull()) { - isTriangulation = false; - } - } - - if (!isTriangulation) { - // calculate deflection - Standard_Real aDeviationCoefficient = 0.001; - - Bnd_Box B; - BRepBndLib::Add(aShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; - Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; - Standard_Real aHLRAngle = 0.349066; - - BRepMesh_IncrementalMesh Inc (aShape, aDeflection, Standard_False, aHLRAngle); - } - - return true; -} - //======================================================================= //function : GetTypeOfSimplePart //purpose : @@ -1286,44 +1238,110 @@ TopoDS_Shape GEOMUtils::ReduceCompound( const TopoDS_Shape& shape ) return result; } -void GEOMUtils::MeshShape( const TopoDS_Shape shape, - double deflection, bool theForced ) +//======================================================================= +//function : DefaultDeflection +//purpose : +//======================================================================= +double GEOMUtils::DefaultDeflection() +{ + return 0.001; +} + +//======================================================================= +//function : CanBeMeshed +//purpose : +//======================================================================= +static bool GEOMUtils_CanBeMeshed (const TopoDS_Shape& theShape, + const bool theCheckMesh, + bool& theHasMesh) { - Standard_Real aDeflection = ( deflection <= 0 ) ? DefaultDeflection() : deflection; - // Is shape triangulated? - Standard_Boolean alreadyMeshed = true; - TopExp_Explorer ex; + theHasMesh = true; + + TopExp_Explorer ex (theShape, TopAbs_FACE); TopLoc_Location aLoc; - for ( ex.Init( shape, TopAbs_FACE ); ex.More() && alreadyMeshed; ex.Next() ) { - const TopoDS_Face& aFace = TopoDS::Face( ex.Current() ); - Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation( aFace, aLoc ); - alreadyMeshed = !aPoly.IsNull(); + if (ex.More()) { + if (theCheckMesh) { + for ( ; ex.More() && theHasMesh; ex.Next() ) { + const TopoDS_Face& aFace = TopoDS::Face( ex.Current() ); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation( aFace, aLoc ); + theHasMesh = !aPoly.IsNull(); + } + } } - - if ( !alreadyMeshed || theForced ) { + else { // no faces, try edges + ex.Init(theShape, TopAbs_EDGE); + if (!ex.More()) { + return false; // nothing to mesh + } + if (theCheckMesh) { + for ( ; ex.More() && theHasMesh; ex.Next() ) { + Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(ex.Current()), aLoc); + theHasMesh = !aPE.IsNull(); + } + } + } + + return true; +} + +//======================================================================= +//function : MeshShape +//purpose : +//======================================================================= +bool GEOMUtils::MeshShape( const TopoDS_Shape theShape, + const double theDeflection, + const bool theForced, + const double theAngleDeflection, + const bool isRelative, + const bool doPostCheck) +{ + Standard_Real aDeflection = (theDeflection <= 0) ? DefaultDeflection() : theDeflection; + + // Is shape triangulated? + bool alreadyMeshed = true; + if (!GEOMUtils_CanBeMeshed (theShape, /*theCheckMesh*/true, alreadyMeshed)) + return false; + + if (alreadyMeshed && !theForced) + return true; + + if (isRelative) { // Compute bounding box Bnd_Box B; - BRepBndLib::Add( shape, B ); - if ( B.IsVoid() ) - return; // NPAL15983 (Bug when displaying empty groups) - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); - - // This magic line comes from Prs3d_ShadedShape.gxx in OCCT - aDeflection = MAX3(aXmax-aXmin, aYmax-aYmin, aZmax-aZmin) * aDeflection * 4; - - // Clean triangulation before compute incremental mesh - BRepTools::Clean( shape ); - - // Compute triangulation - BRepMesh_IncrementalMesh mesh( shape, aDeflection ); + BRepBndLib::Add(theShape, B); + if (B.IsVoid()) + return false; // NPAL15983 (Bug when displaying empty groups) + + Standard_Real aDeviationCoeff = aDeflection; + Standard_Real aMaxChordialDeviation = aDeflection; + aDeflection = Prs3d::GetDeflection(B, aDeviationCoeff, aMaxChordialDeviation); } + + // Clean triangulation before compute incremental mesh + BRepTools::Clean(theShape); + + // Compute triangulation + BRepMesh_IncrementalMesh mesh (theShape, aDeflection, Standard_False, theAngleDeflection); + + if (!doPostCheck) + return true; + + if (!mesh.IsDone()) + return false; + + GEOMUtils_CanBeMeshed(theShape, /*theCheckMesh*/true, alreadyMeshed); + return alreadyMeshed; } -double GEOMUtils::DefaultDeflection() +//======================================================================= +//function : CheckTriangulation +//purpose : +//======================================================================= +bool GEOMUtils::CheckTriangulation (const TopoDS_Shape& theShape) { - return 0.001; + Standard_Real aHLRAngle = 0.349066; + return MeshShape(theShape, DefaultDeflection(), false, aHLRAngle); } //======================================================================= diff --git a/src/GEOMUtils/GEOMUtils.hxx b/src/GEOMUtils/GEOMUtils.hxx index fe36edd65..ba6b7d045 100644 --- a/src/GEOMUtils/GEOMUtils.hxx +++ b/src/GEOMUtils/GEOMUtils.hxx @@ -155,13 +155,6 @@ namespace GEOMUtils Standard_EXPORT void AddSimpleShapes (const TopoDS_Shape& theShape, TopTools_ListOfShape& theList); - /*! - * \brief Build a triangulation on \a theShape if it is absent. - * \param theShape The shape to check/build triangulation on. - * \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation. - */ - Standard_EXPORT bool CheckTriangulation (const TopoDS_Shape& theShape); - /*! * \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape. * \param theShape The shape to get type of. @@ -348,20 +341,38 @@ namespace GEOMUtils Standard_EXPORT TopoDS_Shape ReduceCompound( const TopoDS_Shape& shape ); /*! - * \brief Generate triangulation for the shape. + * \brief Get default deflection coefficient used for triangulation + * \return default deflection value + */ + Standard_EXPORT double DefaultDeflection(); + + /*! + * \brief Generate triangulation for \a theShape. * - * \param shape shape being meshed - * \param deflection deflection coefficient to be used - * \param forced if \c true, causes generation of mesh regardless it is already present in the shape + * \param theShape shape to be meshed. + * \param theDeflection deflection coefficient to be used. + * \param theForced if \c true, causes generation of mesh regardless it is already present in the shape. + * \param theAngleDeflection angular deflection coefficient to be used. + * \param isRelative if true, \a theDeflection is considered relative to \a theShape maximum axial dimension. + * \param doPostCheck if true, check mesh generation result and return corresponding boolean value. + * \retval bool Returns false in the following cases: + * 1. The shape has neither faces nor edges, i.e. impossible to build triangulation or polygon. + * 2. \a theForced is false and \a theShape has no mesh or has incomplete mesh. + * 3. \a doPostCheck is true and mesh generation failed or produced an incomplete mesh. */ - Standard_EXPORT void MeshShape( const TopoDS_Shape shape, - double deflection, bool forced = true ); + Standard_EXPORT bool MeshShape( const TopoDS_Shape theShape, + const double theDeflection = DefaultDeflection(), + const bool theForced = true, + const double theAngleDeflection = 0.5, + const bool isRelative = true, + const bool doPostCheck = false); /*! - * \brief Get default deflection coefficient used for triangulation - * \return default deflection value + * \brief Build a triangulation on \a theShape if it is absent. + * \param theShape The shape to check/build triangulation on. + * \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation. */ - Standard_EXPORT double DefaultDeflection(); + Standard_EXPORT bool CheckTriangulation (const TopoDS_Shape& theShape); /** * \brief Check if the shape is not a closed wire or edge. diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index 73a42c007..1e02554d7 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -186,7 +186,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire //============================================================================= GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire (const GEOM::ListOfGO& theEdgesAndWires, - const CORBA::Double theTolerance) + const CORBA::Double theTolerance, + const GEOM::wire_build_mode theMode) { GEOM::GEOM_Object_var aGEOMObject; @@ -204,9 +205,22 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire aShapes.push_back(aSh); } + // Mode of gaps closing + GEOMImpl_WireBuildMode aMode = GEOMImpl_WBM_FixTolerance; + switch (theMode) { + case GEOM::WBM_Approximation: + aMode = GEOMImpl_WBM_Approximation; + break; + case GEOM::WBM_KeepCurveType: + aMode = GEOMImpl_WBM_KeepCurveType; + break; + default: + break; + } + // Make Solid Handle(::GEOM_Object) anObject = - GetOperations()->MakeWire(aShapes, theTolerance); + GetOperations()->MakeWire(aShapes, theTolerance, aMode); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -310,6 +324,47 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceFromSurface return GetObject(anObject); } +//============================================================================= +/*! + * MakeWrappedFace + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWrappedFace + (const GEOM::ListOfGO& theEdges, + const GEOM::ListOfGO& theVertices, + const CORBA::Double theTolerance) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the edges + std::list anEdges; + for( CORBA::ULong ind = 0; ind < theEdges.length(); ind++ ) { + Handle(::GEOM_Object) anObject = GetObjectImpl( theEdges[ind] ); + anEdges.push_back(anObject); + } + + //Get the vertices + std::list aVertices; + for( CORBA::ULong ind = 0; ind < theVertices.length(); ind++ ) { + Handle(::GEOM_Object) anObject = GetObjectImpl( theVertices[ind] ); + aVertices.push_back(anObject); + } + + //Create the Face + Handle(::GEOM_Object) anObject = + GetOperations()->MakeWrappedFace(anEdges, aVertices, theTolerance); + + // enable warning status + if (anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + + //============================================================================= /*! * MakeFaceWithConstraints diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.hh b/src/GEOM_I/GEOM_IShapesOperations_i.hh index f1518a005..2d8cdf36e 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.hh +++ b/src/GEOM_I/GEOM_IShapesOperations_i.hh @@ -56,7 +56,8 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : const CORBA::Double theAngularTolerance); GEOM::GEOM_Object_ptr MakeWire (const GEOM::ListOfGO& theEdgesAndWires, - const CORBA::Double theTolerance); + const CORBA::Double theTolerance, + const GEOM::wire_build_mode theMode); GEOM::GEOM_Object_ptr MakeFace (GEOM::GEOM_Object_ptr theWire, CORBA::Boolean isPlanarWanted); @@ -67,6 +68,10 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::GEOM_Object_ptr MakeFaceFromSurface(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theWire); + GEOM::GEOM_Object_ptr MakeWrappedFace(const GEOM::ListOfGO& theEdges, + const GEOM::ListOfGO& theVertices, + const CORBA::Double theTolerance); + GEOM::GEOM_Object_ptr MakeFaceWithConstraints (const GEOM::ListOfGO& theConstraints); GEOM::GEOM_Object_ptr MakeShell (const GEOM::ListOfGO& theFacesAndShells); diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index ecca07532..c510ec9a3 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -2153,7 +2153,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeWire (GEOM::GEOM_List_ptr theEdgesAndWi if (GEOM_List_i* aListImplEW = dynamic_cast*>(GetServant(theEdgesAndWires, myPOA).in())) { getShapesOp(); - GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeWire(aListImplEW->GetList(), theTolerance); + GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeWire(aListImplEW->GetList(), theTolerance, GEOM::WBM_FixTolerance); endService( " GEOM_Superv_i::MakeWire" ); return anObj; } diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 9564a2309..7cf3edc64 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -4717,6 +4717,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen): return anObj ## Create a wire from the set of edges and wires. + # To close a gap, enlarges wire tolerance. + # # @param theEdgesAndWires List of edges and/or wires. # @param theTolerance Maximum distance between vertices, that will be merged. # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()) @@ -4731,6 +4733,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None): """ Create a wire from the set of edges and wires. + To close a gap, enlarges wire tolerance. Parameters: theEdgesAndWires List of edges and/or wires. @@ -4744,11 +4747,90 @@ class geomBuilder(GEOM._objref_GEOM_Gen): New GEOM.GEOM_Object, containing the created wire. """ # Example: see GEOM_TestAll.py - anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance) + anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance, GEOM.WBM_FixTolerance) RaiseIfFailed("MakeWire", self.ShapesOp) self._autoPublish(anObj, theName, "wire") return anObj + ## Create a wire from the set of edges and wires. + # To close a gap, replaces curves, neighbour to the gap, with new curves + # of the same type and close parameters, connecting in the middle of the gap. + # + # @param theEdgesAndWires List of edges and/or wires. + # @param theTolerance Maximum distance between vertices, that will be merged. + # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()) + # @param theName Object name; when specified, this parameter is used + # for result publication in the study. Otherwise, if automatic + # publication is switched on, default value is used for result name. + # + # @return New GEOM.GEOM_Object, containing the created wire. + # + # @ref tui_creation_wire "Example" + @ManageTransactions("ShapesOp") + def MakeWireConstCurveType(self, theEdgesAndWires, theTolerance = 1e-07, theName=None): + """ + Create a wire from the set of edges and wires. + To close a gap, replaces curves, neighbour to the gap, with new curves + of the same type and close parameters, connecting in the middle of the gap. + + Parameters: + theEdgesAndWires List of edges and/or wires. + theTolerance Maximum distance between vertices, that will be merged. + Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()). + theName Object name; when specified, this parameter is used + for result publication in the study. Otherwise, if automatic + publication is switched on, default value is used for result name. + + Returns: + New GEOM.GEOM_Object, containing the created wire. + """ + anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance, GEOM.WBM_KeepCurveType) + RaiseIfFailed("MakeWireConstCurveType", self.ShapesOp) + self._autoPublish(anObj, theName, "wire") + return anObj + + ## Create a wire from the set of edges and wires. + # Possible gaps are closed according to theMode. + # + # @param theEdgesAndWires List of edges and/or wires. + # @param theTolerance Maximum distance between vertices, that will be merged. + # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()) + # @param theMode GEOM.wire_build_mode Mode of gaps closing. + # Possible values are GEOM.WBM_FixTolerance, GEOM.WBM_KeepCurveType + # and GEOM.WBM_Approximation. + # @param theName Object name; when specified, this parameter is used + # for result publication in the study. Otherwise, if automatic + # publication is switched on, default value is used for result name. + # + # @return New GEOM.GEOM_Object, containing the created wire. + # + # @ref tui_creation_wire "Example" + @ManageTransactions("ShapesOp") + def MakeWireWithMode(self, theEdgesAndWires, theTolerance = 1e-07, + theMode = GEOM.WBM_Approximation, theName=None): + """ + Create a wire from the set of edges and wires. + Possible gaps are closed according to theMode. + + Parameters: + theEdgesAndWires List of edges and/or wires. + theTolerance Maximum distance between vertices, that will be merged. + Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()). + theMode GEOM.wire_build_mode Mode of gaps closing. + Possible values are GEOM.WBM_FixTolerance, GEOM.WBM_KeepCurveType + and GEOM.WBM_Approximation. + theName Object name; when specified, this parameter is used + for result publication in the study. Otherwise, if automatic + publication is switched on, default value is used for result name. + + Returns: + New GEOM.GEOM_Object, containing the created wire. + """ + anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance, theMode) + RaiseIfFailed("MakeWireWithMode", self.ShapesOp) + self._autoPublish(anObj, theName, "wire") + return anObj + ## Create a face on the given wire. # @param theWire closed Wire or Edge to build the face on. # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face. @@ -4878,6 +4960,39 @@ class geomBuilder(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp) self._autoPublish(anObj, theName, "face") return anObj + + ## Create a non-planar face from a list of closed edges and a list of vertices. + # @param theEdges list of Edges(must be closed but not nesessarily belong to the same plane). + # @param theVertices list of vertices through which the result face must pass. + # @param theTolerance tolerance + # @param theName Object name; when specified, this parameter is used + # for result publication in the study. Otherwise, if automatic + # publication is switched on, default value is used for result name. + # + # @return New GEOM.GEOM_Object, containing the created face. + # + # @ref tui_creation_face "Example" + @ManageTransactions("ShapesOp") + def MakeWrappedFace(self, theEdges, theVertices, theTolerance, theName=None): + """ + Create a non-planar face from a list of closed edges and a list of vertices. + + Parameters: + theEdges list of Edges(must be closed but not nesessarily belong to the same plane). + theVertices list of vertices through which the result face must pass. + theTolerance tolerance + theName Object name; when specified, this parameter is used + for result publication in the study. Otherwise, if automatic + publication is switched on, default value is used for result name. + + Returns: + New GEOM.GEOM_Object, containing the created face. + """ + # Example: see GEOM_TestAll.py + anObj = self.ShapesOp.MakeWrappedFace(theEdges, theVertices, theTolerance) + RaiseIfFailed("MakeWrappedFace", self.ShapesOp) + self._autoPublish(anObj, theName, "face") + return anObj ## Create a face from a set of edges with the given constraints. # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples): diff --git a/src/OCC2VTK/OCC2VTK_Tools.cxx b/src/OCC2VTK/OCC2VTK_Tools.cxx index 377d4c3c0..e125b6806 100644 --- a/src/OCC2VTK/OCC2VTK_Tools.cxx +++ b/src/OCC2VTK/OCC2VTK_Tools.cxx @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/src/STEPPlugin/STEPPlugin_ExportDriver.cxx b/src/STEPPlugin/STEPPlugin_ExportDriver.cxx index 1ed99c516..fa7492ea1 100644 --- a/src/STEPPlugin/STEPPlugin_ExportDriver.cxx +++ b/src/STEPPlugin/STEPPlugin_ExportDriver.cxx @@ -33,6 +33,8 @@ // OOCT includes #include #include +#include +#include #include #include #include @@ -126,12 +128,22 @@ Standard_Integer STEPPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& /*l Interface_Static::SetCVal("xstep.cascade.unit","M"); Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString()); Interface_Static::SetIVal("write.step.nonmanifold", 1); -#else +#elif OCC_VERSION_LARGE < 0x07080000 STEPControl_Writer aWriterTmp; Interface_Static::SetCVal("xstep.cascade.unit","M"); Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString()); Interface_Static::SetIVal("write.step.nonmanifold", 1); STEPControl_Writer aWriter; +#else + STEPControl_Writer aWriter; + Interface_Static::SetCVal("xstep.cascade.unit","M"); + Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString()); + Interface_Static::SetIVal("write.step.nonmanifold", 1); + Handle(StepData_StepModel) aModel = aWriter.Model(); + aModel->InternalParameters.InitFromStatic(); + Standard_Integer aWriteUnitInt = Interface_Static::IVal("write.step.unit"); + Standard_Real aWriteUnitReal = UnitsMethods::GetLengthFactorValue(aWriteUnitInt); + aModel->SetWriteLengthUnit(aWriteUnitReal); #endif IFSelect_ReturnStatus status = aWriter.Transfer( aShape, STEPControl_AsIs ); diff --git a/src/STLPlugin/STLPlugin_ExportDriver.cxx b/src/STLPlugin/STLPlugin_ExportDriver.cxx index b98686a94..0bb1352ca 100644 --- a/src/STLPlugin/STLPlugin_ExportDriver.cxx +++ b/src/STLPlugin/STLPlugin_ExportDriver.cxx @@ -102,6 +102,7 @@ Standard_Integer STLPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& log) BRepBndLib::Add( aShape, bndBox ); bndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); aDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * aDeflection; + aDeflection = MAX2( aDeflection, Precision::Confusion() ); } //Compute triangulation BRepTools::Clean( aCopyShape ); diff --git a/test/data/WrappedFace_bspline_edges.brep b/test/data/WrappedFace_bspline_edges.brep new file mode 100644 index 000000000..b3d5879e1 --- /dev/null +++ b/test/data/WrappedFace_bspline_edges.brep @@ -0,0 +1,177 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 2 +1 + 1 0 0 0 + 0 1 0 0 + 0 0 1 50 +2 1 -1 0 +Curve2ds 11 +1 0 -100 1 0 +1 0 0 1 0 +1 1.5707963267948966 50 0 1 +1 0 0 1 0 +1 0 100 1 0 +8 0 100 +1 6.2831853071795862 50 0 1 +8 0 100 +1 0 50 0 1 +1 0 150 1 0 +2 0 0 1 0 -0 1 100 +1 0 50 1 0 +2 0 0 1 0 -0 1 100 +Curves 4 +1 0 100 0 0 0 1 +1 100 0 0 0 0 1 +2 0 0 150 0 0 1 1 0 -0 -0 1 0 100 +2 0 0 50 0 0 1 1 0 -0 -0 1 0 100 +Polygon3D 4 +2 1 +0.4000000008 +0 100 0 0 100 100 +0 100 +2 1 +0.4000000008 +100 0 0 100 0 100 +0 100 +14 1 +0.4000000008 +100 0 150 99.2708874098054 12.0536680255323 150 97.0941817426052 23.9315664287558 150 93.5016242685415 35.4604887042536 150 88.545602565321 46.4723172043768 150 82.2983865893656 56.8064746731156 150 74.8510748171101 66.3122658240795 150 66.3122658240795 74.8510748171101 150 56.8064746731156 82.2983865893656 150 46.4723172043769 88.545602565321 150 35.4604887042536 93.5016242685415 150 23.9315664287558 97.0941817426052 150 12.0536680255323 99.2708874098054 150 0 100 150 +0 0.12083048667653 0.241660973353061 0.362491460029591 0.483321946706122 0.604152433382652 0.724982920059183 0.845813406735713 0.966643893412244 1.08747438008877 1.2083048667653 1.32913535344184 1.44996584011837 1.5707963267949 +14 1 +0.4000000008 +100 0 50 99.2708874098054 12.0536680255323 50 97.0941817426052 23.9315664287558 50 93.5016242685415 35.4604887042536 50 88.545602565321 46.4723172043768 50 82.2983865893656 56.8064746731156 50 74.8510748171101 66.3122658240795 50 66.3122658240795 74.8510748171101 50 56.8064746731156 82.2983865893656 50 46.4723172043769 88.545602565321 50 35.4604887042536 93.5016242685415 50 23.9315664287558 97.0941817426052 50 12.0536680255323 99.2708874098054 50 0 100 50 +0 0.12083048667653 0.241660973353061 0.362491460029591 0.483321946706122 0.604152433382652 0.724982920059183 0.845813406735713 0.966643893412244 1.08747438008877 1.2083048667653 1.32913535344184 1.44996584011837 1.5707963267949 +PolygonOnTriangulations 10 +2 3 4 +p 0.4000000008 1 0 100 +2 1 3 +p 0.4000000008 1 0 100 +2 49 48 +p 0.4000000008 1 0 100 +2 1 2 +p 0.4000000008 1 0 100 +2 2 4 +p 0.4000000008 1 0 100 +2 96 1 +p 0.4000000008 1 0 100 +10 39 40 41 42 43 44 45 46 47 48 +p 1.2000000008 1 0 0.174532925199433 0.349065850398866 0.523598775598299 0.698131700797732 0.872664625997165 1.0471975511966 1.22173047639603 1.39626340159546 1.5707963267949 +10 1 2 3 4 5 6 7 8 9 10 +p 1.2000000008 1 0 0.174532925199433 0.349065850398866 0.523598775598299 0.698131700797732 0.872664625997165 1.0471975511966 1.22173047639603 1.39626340159546 1.5707963267949 +10 50 51 52 53 54 55 56 57 58 49 +p 1.2000000008 1 0 0.174532925199433 0.349065850398866 0.523598775598299 0.698131700797732 0.872664625997165 1.0471975511966 1.22173047639603 1.39626340159546 1.5707963267949 +10 1 2 3 4 5 6 7 8 9 10 +p 1.2000000008 1 0 0.174532925199433 0.349065850398866 0.523598775598299 0.698131700797732 0.872664625997165 1.0471975511966 1.22173047639603 1.39626340159546 1.5707963267949 +Surfaces 7 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 100 0 -0 1 0 0 0 1 1 0 -0 +2 0 0 0 0 0 1 1 0 -0 -0 1 0 100 +1 100 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 100 0 0 1 1 0 -0 -0 1 0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +Triangulations 7 +4 2 1 0.4000000008 +0 0 0 0 0 100 0 100 0 0 100 100 0 0 100 0 0 -100 100 -100 2 1 3 2 3 4 +4 2 1 0.4000000008 +0 100 0 100 100 0 0 100 100 100 100 100 0 0 0 100 100 0 100 100 4 2 1 4 1 3 +96 94 1 1.2000000008 +100 0 150 100 -2.44929359829471e-14 300 100 -2.44929359829471e-14 300 98.4807753012208 17.364817766693 300 93.9692620785908 34.2020143325669 300 86.6025403784439 50 300 76.6044443118978 64.2787609686539 300 64.2787609686539 76.6044443118978 300 50 86.6025403784439 300 34.2020143325669 93.9692620785908 300 17.364817766693 98.4807753012208 300 6.12323399573677e-15 100 300 -17.364817766693 98.4807753012208 300 -34.2020143325669 93.9692620785908 300 -50 86.6025403784439 300 -64.2787609686539 76.6044443118978 300 -76.6044443118978 64.278760968654 300 -86.6025403784438 50.0000000000001 300 -93.9692620785908 34.202014332567 300 -98.4807753012208 17.3648177666932 300 -100 1.45473230946492e-13 300 -98.4807753012208 -17.3648177666929 300 -93.9692620785909 -34.2020143325667 300 -86.602540378444 -49.9999999999998 300 -76.604444311898 -64.2787609686538 300 -64.2787609686541 -76.6044443118977 300 -50.0000000000002 -86.6025403784437 300 -34.2020143325671 -93.9692620785908 300 -17.3648177666933 -98.4807753012208 300 -2.84823227897248e-13 -100 300 17.3648177666927 -98.4807753012209 300 34.2020143325666 -93.969262078591 300 49.9999999999997 -86.602540378444 300 64.2787609686536 -76.604444311898 300 76.6044443118976 -64.2787609686542 300 86.6025403784437 -50.0000000000004 300 93.9692620785907 -34.2020143325673 300 98.4807753012207 -17.3648177666935 300 100 0 150 98.4807753012208 17.364817766693 150 93.9692620785908 34.2020143325669 150 86.6025403784439 50 150 76.6044443118978 64.2787609686539 150 64.2787609686539 76.6044443118978 150 50 86.6025403784439 150 34.2020143325669 93.9692620785908 150 17.364817766693 98.4807753012208 150 0 100 150 0 100 50 100 0 50 98.4807753012208 17.364817766693 50 93.9692620785908 34.2020143325669 50 86.6025403784439 50 50 76.6044443118978 64.2787609686539 50 64.2787609686539 76.6044443118978 50 50 86.6025403784439 50 34.2020143325669 93.9692620785908 50 17.364817766693 98.4807753012208 50 100 -2.44929359829471e-14 0 98.4807753012208 17.364817766693 0 93.9692620785908 34.2020143325669 0 86.6025403784439 50 0 76.6044443118978 64.2787609686539 0 64.2787609686539 76.6044443118978 0 50 86.6025403784439 0 34.2020143325669 93.9692620785908 0 17.364817766693 98.4807753012208 0 6.12323399573677e-15 100 0 -17.364817766693 98.4807753012208 0 -34.2020143325669 93.9692620785908 0 -50 86.6025403784439 0 -64.2787609686539 76.6044443118978 0 -76.6044443118978 64.278760968654 0 -86.6025403784438 50.0000000000001 0 -93.9692620785908 34.202014332567 0 -98.4807753012208 17.3648177666932 0 -100 1.45473230946492e-13 0 -98.4807753012208 -17.3648177666929 0 -93.9692620785909 -34.2020143325667 0 -86.602540378444 -49.9999999999998 0 -76.604444311898 -64.2787609686538 0 -64.2787609686541 -76.6044443118977 0 -50.0000000000002 -86.6025403784437 0 -34.2020143325671 -93.9692620785908 0 -17.3648177666933 -98.4807753012208 0 -2.84823227897248e-13 -100 0 17.3648177666927 -98.4807753012209 0 34.2020143325666 -93.969262078591 0 49.9999999999997 -86.602540378444 0 64.2787609686536 -76.604444311898 0 76.6044443118976 -64.2787609686542 0 86.6025403784437 -50.0000000000004 0 93.9692620785907 -34.2020143325673 0 98.4807753012207 -17.3648177666935 0 100 -2.44929359829471e-14 0 100 0 50 6.28318530717959 150 6.28318530717959 300 0 300 0.174532925199433 300 0.349065850398866 300 0.523598775598299 300 0.698131700797732 300 0.872664625997165 300 1.0471975511966 300 1.22173047639603 300 1.39626340159546 300 1.5707963267949 300 1.74532925199433 300 1.91986217719376 300 2.0943951023932 300 2.26892802759263 300 2.44346095279206 300 2.61799387799149 300 2.79252680319093 300 2.96705972839036 300 3.14159265358979 300 3.31612557878922 300 3.49065850398866 300 3.66519142918809 300 3.83972435438752 300 4.01425727958696 300 4.18879020478639 300 4.36332312998582 300 4.53785605518525 300 4.71238898038469 300 4.88692190558412 300 5.06145483078355 300 5.23598775598299 300 5.41052068118242 300 5.58505360638185 300 5.75958653158128 300 5.93411945678072 300 6.10865238198015 300 0 150 0.174532925199433 150 0.349065850398866 150 0.523598775598299 150 0.698131700797732 150 0.872664625997165 150 1.0471975511966 150 1.22173047639603 150 1.39626340159546 150 1.5707963267949 150 1.5707963267949 50 0 50 0.174532925199433 50 0.349065850398866 50 0.523598775598299 50 0.698131700797732 50 0.872664625997165 50 1.0471975511966 50 1.22173047639603 50 1.39626340159546 50 0 0 0.174532925199433 0 0.349065850398866 0 0.523598775598299 0 0.698131700797732 0 0.872664625997165 0 1.0471975511966 0 1.22173047639603 0 1.39626340159546 0 1.5707963267949 0 1.74532925199433 0 1.91986217719376 0 2.0943951023932 0 2.26892802759263 0 2.44346095279206 0 2.61799387799149 0 2.79252680319093 0 2.96705972839036 0 3.14159265358979 0 3.31612557878922 0 3.49065850398866 0 3.66519142918809 0 3.83972435438752 0 4.01425727958696 0 4.18879020478639 0 4.36332312998582 0 4.53785605518525 0 4.71238898038469 0 4.88692190558412 0 5.06145483078355 0 5.23598775598299 0 5.41052068118242 0 5.58505360638185 0 5.75958653158128 0 5.93411945678072 0 6.10865238198015 0 6.28318530717959 0 6.28318530717959 50 60 50 59 51 50 60 52 51 60 52 60 61 4 3 39 4 39 40 53 52 61 53 61 62 5 4 40 5 40 41 54 53 62 54 62 63 6 5 41 6 41 42 55 54 63 55 63 64 7 6 42 7 42 43 56 55 64 56 64 65 8 7 43 8 43 44 57 56 65 57 65 66 9 44 45 9 8 44 46 9 45 67 57 66 58 57 67 10 9 46 49 58 67 49 67 68 11 46 47 11 10 46 69 48 49 69 49 68 12 47 48 12 11 47 13 12 48 13 48 69 14 69 70 14 13 69 15 70 71 15 14 70 16 71 72 16 15 71 17 72 73 17 16 72 18 73 74 18 17 73 19 18 74 19 74 75 20 19 75 20 75 76 21 20 76 21 76 77 22 21 77 22 77 78 22 78 79 23 22 79 24 23 79 24 79 80 25 24 80 25 80 81 26 25 81 26 81 82 26 82 83 27 26 83 28 27 83 28 83 84 29 28 84 29 84 85 30 29 85 30 85 86 31 30 86 31 86 87 31 87 88 32 31 88 33 32 88 33 88 89 33 89 90 34 33 90 35 34 90 35 90 91 36 35 91 36 91 92 37 36 92 37 92 93 96 94 95 38 37 93 38 93 94 1 38 94 1 94 96 2 38 1 +4 2 1 0.4000000008 +100 0 0 100 0 100 100 100 0 100 100 100 0 0 100 0 0 -100 100 -100 2 1 3 2 3 4 +4 2 1 0.4000000008 +0 0 0 100 0 0 0 0 100 100 0 100 0 0 0 100 100 0 100 100 4 2 1 4 1 3 +11 9 1 1.2000000008 +100 0 150 98.4807753012208 17.364817766693 150 93.9692620785908 34.2020143325669 150 86.6025403784439 50 150 76.6044443118978 64.2787609686539 150 64.2787609686539 76.6044443118978 150 50 86.6025403784439 150 34.2020143325669 93.9692620785908 150 17.364817766693 98.4807753012208 150 0 100 150 0 0 150 100 0 98.4807753012208 17.364817766693 93.9692620785908 34.2020143325669 86.6025403784439 50 76.6044443118978 64.2787609686539 64.2787609686539 76.6044443118978 50 86.6025403784439 34.2020143325669 93.9692620785908 17.364817766693 98.4807753012208 0 100 0 0 9 10 11 2 11 1 8 9 11 3 11 2 4 11 3 7 8 11 5 11 4 6 7 11 6 11 5 +11 9 1 1.2000000008 +100 0 50 98.4807753012208 17.364817766693 50 93.9692620785908 34.2020143325669 50 86.6025403784439 50 50 76.6044443118978 64.2787609686539 50 64.2787609686539 76.6044443118978 50 50 86.6025403784439 50 34.2020143325669 93.9692620785908 50 17.364817766693 98.4807753012208 50 0 100 50 0 0 50 100 0 98.4807753012208 17.364817766693 93.9692620785908 34.2020143325669 86.6025403784439 50 76.6044443118978 64.2787609686539 64.2787609686539 76.6044443118978 50 86.6025403784439 34.2020143325669 93.9692620785908 17.364817766693 98.4807753012208 0 100 0 0 9 10 11 2 11 1 8 9 11 3 11 2 4 11 3 7 8 11 5 11 4 6 7 11 6 11 5 + +TShapes 9 +Ve +1.00000006123234e-07 +0 100 100 +0 0 + +0101101 +* +Ve +1.00000006123234e-07 +0 100 0 +0 0 + +0101101 +* +Ed + 1.00000006123234e-07 1 1 0 +1 1 0 0 100 +2 1 1 0 0 100 +2 2 2 0 0 100 +6 1 1 0 +6 2 2 0 +2 3 3 2 0 100 +6 3 3 2 +5 1 0 +0 + +0101000 +-9 0 +8 0 * +Ve +1.50001e-07 +100 0 100 +0 0 + +0101101 +* +Ve +1.50001e-07 +100 0 0 +0 0 + +0101101 +* +Ed + 1.00000024492936e-07 1 1 0 +1 2 0 0 100 +2 4 4 0 0 100 +2 5 5 0 0 100 +6 4 4 0 +6 5 5 0 +3 6 7C0 3 2 0 100 +6 6 3 2 +5 2 0 +0 + +0101000 +-6 0 +5 0 * +Ed + 1e-07 1 1 0 +1 3 0 0 1.5707963267949 +2 8 3 0 0 1.5707963267949 +2 9 6 1 0 1.5707963267949 +6 7 3 0 +6 8 6 0 +5 3 0 +0 + +0101000 ++6 1 -9 1 * +Ed + 1e-07 1 1 0 +1 4 0 0 1.5707963267949 +2 10 3 0 0 1.5707963267949 +2 11 7 1 0 1.5707963267949 +6 9 3 0 +6 10 7 0 +5 4 0 +0 + +0101000 ++5 1 -8 1 * +Co + +1100000 +-7 1 +4 1 +3 0 -2 0 * + ++1 0 \ No newline at end of file diff --git a/test/data/WrappedFace_bspline_vertices.brep b/test/data/WrappedFace_bspline_vertices.brep new file mode 100644 index 000000000..c652ecd38 --- /dev/null +++ b/test/data/WrappedFace_bspline_vertices.brep @@ -0,0 +1,60 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 0 +Curve2ds 0 +Curves 0 +Polygon3D 0 +PolygonOnTriangulations 0 +Surfaces 0 +Triangulations 0 + +TShapes 7 +Ve +1e-07 +30.9016994374947 95.1056516295154 60 +0 0 + +0101101 +* +Ve +1e-07 +53.5826794978997 84.4327925502015 90 +0 0 + +0101101 +* +Ve +1e-07 +95.1056516295154 30.9016994374947 75 +0 0 + +0101101 +* +Ve +1e-07 +80.9016994374947 58.7785252292473 120 +0 0 + +0101101 +* +Ve +1e-07 +92.9776485888251 36.8124552684678 135 +0 0 + +0101101 +* +Ve +1e-07 +30.9016994374947 95.1056516295154 129 +0 0 + +0101101 +* +Co + +1100000 ++7 0 +6 0 +5 0 +4 0 +3 0 +2 0 * + ++1 0 \ No newline at end of file diff --git a/test/data/WrappedFace_sphere_face.brep b/test/data/WrappedFace_sphere_face.brep new file mode 100755 index 000000000..fec448673 --- /dev/null +++ b/test/data/WrappedFace_sphere_face.brep @@ -0,0 +1,89 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 1 +1 + 1 0 0 -25 + 0 1 0 0 + 0 0 1 0 +Curve2ds 4 +7 0 0 8 219 32 3.1415926535897931 1.318116071652818 3.1891213099488587 1.318116071652818 3.2366499663448849 1.3174494833264134 3.283840502917883 1.3161163110075904 3.3303548257263174 1.3141263873985736 3.3758846467371768 1.3114994674115223 3.4201823689259072 1.3082631680535997 3.463064495965531 1.3044498869759045 3.5451024940117137 1.2958072286237334 3.5843061322988525 1.2909946597522894 3.6218984793871414 1.2856901079814094 3.6578162828468521 1.2799292323119857 3.6920457213965392 1.2737477631992462 3.7246093437545147 1.2671800055047839 3.75555256992571 1.2602580385124882 3.8138606064339315 1.2458781937786021 3.8412737614369821 1.2384303782200674 3.8672334472503991 1.2306963236747492 3.8918115507606217 1.2227019751475154 3.9150857788521591 1.2144707144524247 3.9371346937574891 1.2060234595452157 3.9580350162802627 1.1973789159101054 4.0168910226981032 1.17117933017418 4.0517546108994793 1.1531049439456638 4.0830115225417103 1.1344581639227727 4.1111724191687244 1.1153365619647957 4.1366571473081422 1.0958151337767958 4.1598172185576914 1.0759534236665331 4.1809442334757989 1.0557991791805552 4.2190174218057646 1.0156213507107801 4.2360736023371768 0.99561336494835673 4.2516740356729201 0.97540287330935627 4.2659994988318886 0.95501757262246656 4.2791988878059612 0.93447979712628637 4.2913965356754638 0.91380795348557298 4.3026974952544137 0.89301739534788571 4.3335229671191993 0.83163458607718899 4.3508245879661445 0.79075119916035419 4.3657471617079864 0.74956544548740567 4.3787234456649458 0.70813850634613118 4.3900714888695802 0.66651572856017083 4.400029979802639 0.62473128452825222 4.4087840046276643 0.58281227803808933 4.4236922659335693 0.50137587782305948 4.4299748034643791 0.46187213161851814 4.4354457048505225 0.42228738235921703 4.4401938609332774 0.38263570586484263 4.4442875949010272 0.34292868825218292 4.447780006582839 0.30317622021793889 4.4507117173270245 0.2633869445400418 4.4576157339459836 0.14890944427676123 4.4602539472543867 0.074148304296457468 4.4612279224711529 -0.00066322955666464622 4.4606097123942163 -0.075483853137257029 4.4583886929503933 -0.15027424510896026 4.4544622265430007 -0.22499221660584112 4.4486282191598399 -0.29958848108010311 4.4369250993772287 -0.40654316335934532 4.4329216496968531 -0.43905764528812774 4.4284430709445246 -0.47152920851099012 4.4234486499040031 -0.5039510729812946 4.4178886880104642 -0.53631537877864588 4.4117023380737805 -0.56861286962130964 4.404813926294568 -0.60083235761564235 4.389919804360277 -0.66307926085728275 4.3820108374212134 -0.69311782447583636 4.373319908597594 -0.72306389209570199 4.3637509684781435 -0.75290369182835093 4.3531865630855577 -0.78262045993617591 4.3414815644048534 -0.81219354744094452 4.3284520831798456 -0.8415967000947322 4.3001718473390049 -0.8981679570487664 4.2851108206559729 -0.92536089414829803 4.2684730061100709 -0.95234460739857241 4.2500137492716021 -0.97908320855367492 4.2294275083841057 -1.0055314144151453 4.2063294655881691 -1.0316306005208844 4.1802169017730195 -1.0573025572614343 4.1364656067734833 -1.0942169225376597 4.1216948114604417 -1.1058797203276032 4.1060483397781127 -1.1174126479505162 4.0894504644143126 -1.1288026054403986 4.071817081733883 -1.1400345795056239 4.0530547545792421 -1.1510912445303951 4.0330604893159574 -1.1619524819253098 3.9910527585524269 -1.1829046130948553 3.969121920513524 -1.193008972867653 3.9458297650713234 -1.2028865932009865 3.9210682785644622 -1.2125131986866791 3.8947238933490667 -1.2218611607241101 3.86668058423286 -1.2308989539559518 3.8368271055429277 -1.2395908281888357 3.774307120468523 -1.2559437155329225 3.7417576738043863 -1.2636284553476571 3.7073384517625527 -1.2709151657304574 3.6709817421069602 -1.2777642398732496 3.6326481186861201 -1.2841328896729465 3.5923427335001179 -1.2899758909156844 3.5501385467876956 -1.2952478959044091 3.4636029923086014 -1.3044199217298862 3.4193793156700849 -1.3083576689796246 3.3736478742412146 -1.3116815687690178 3.3266101719600556 -1.3143560327162049 3.278540482331664 -1.3163508868656209 3.2297819383425121 -1.3176450231551371 3.1807088008447471 -1.3182287324338826 3.0842066816157758 -1.3179820157598279 3.0367742431330953 -1.3171952116246075 2.9897316235437756 -1.3157442870842715 2.9434128012235306 -1.3136403147764213 2.8981189220703527 -1.3109041085426725 2.8540890216308981 -1.307564032139453 2.81149815169023 -1.3036529401816563 2.7307105570501253 -1.2948979341360871 2.6924180962717741 -1.2900869908879655 2.6556921588860405 -1.2848050412201601 2.62058760272987 -1.2790860135365278 2.5871141319205293 -1.2729637724206739 2.5552483125006811 -1.2664707868283771 2.5249457786091556 -1.2596374255625258 2.4403527467387045 -1.2386470472992828 2.390206637561505 -1.2236299801575115 2.3452861969080914 -1.2076447550934972 2.3049734520118363 -1.190862792705957 2.2686825286382373 -1.1734164847898683 2.2358981528436743 -1.155411519389645 2.2061757480588908 -1.1369319699122957 2.1537876259299567 -1.1003403403166565 2.1307969708076842 -1.0822774760161311 2.1098525687595568 -1.0639134877887457 2.0906932187085658 -1.0452920432221049 2.0731021746796898 -1.0264480114881209 2.0568984440663258 -1.0074098238642586 2.0419287412504947 -0.98820098823095659 2.002064524380077 -0.93254159173909879 1.9799469356460122 -0.89571128789293653 1.9608517267979551 -0.85848007394633896 1.9442027991681243 -0.82093064766513635 1.9295797175318512 -0.78312341069204194 1.9166656051131667 -0.74510326298991458 1.9052149381818488 -0.70690528898314686 1.8861257435647465 -0.63500290105157375 1.8781896108382485 -0.60133363769516635 1.8710959103499576 -0.56756822949644992 1.8647451683623331 -0.53372118624935183 1.8590584296185 -0.49980430459196157 1.8539718014013316 -0.46582746172684131 1.8494333836375589 -0.43179905863243201 1.8383434854690126 -0.33809929249123988 1.8328350757269618 -0.27833668499869191 1.8286479412836343 -0.21847780260173977 1.8256435585572035 -0.15855161481169944 1.8237351585430588 -0.098582494983133984 1.8228786252625468 -0.038592237062601953 1.8230666341883606 0.021398018221502071 1.8252840508978476 0.12634158855163929 1.8268413513516033 0.17130474812742644 1.8290202320588733 0.2162457530765769 1.8318483639408214 0.26115468578822743 1.8353679958926676 0.30602065695819114 1.8396382265475535 0.35083128888889115 1.8447403258090465 0.39557185146545515 1.8553244424423214 0.47371252997231134 1.8603925985951262 0.50715147263850258 1.8660410433341426 0.5405326088661937 1.8723283000055062 0.57384681332510468 1.8793262039381204 0.60708327134540596 1.8871234218434125 0.64022897629126629 1.8958317267540097 0.67326781305587247 1.9129213674028811 0.73086215488403572 1.9208401773860204 0.75547356560545242 1.9294153342174738 0.78000426768976894 1.9387193720097002 0.80444391737989918 1.9488385877810401 0.82878019900115163 1.9598767187021684 0.85299827711218867 1.9719607258979133 0.87707986520084191 1.995216975664132 0.91894293111987024 2.0058619131433297 0.93679433321874861 2.0172520595010162 0.95454599031408172 2.0294649827445053 0.97218641536931016 2.0425906828789859 0.9897021638703174 2.0567345774110617 1.0070772619615249 2.0720213727804566 1.0242923662962062 2.1010336584244649 1.0540971225796323 2.1141940524356762 1.0667671912579313 2.1281437491697162 1.079323803863101 2.1429531400816586 1.0917554662818816 2.1587012616880372 1.1040489601357635 2.1754771599594824 1.1161889657334907 2.1933809907690289 1.1281575742817493 2.2268816543162151 1.1487657378247886 2.2419362466376858 1.1574895181439673 2.2577350227699498 1.1660961002298293 2.2743285796004784 1.1745755590748672 2.2917710616558651 1.1829168130794798 2.3101199924401845 1.191107452213656 2.3294355232708965 1.1991335640122511 2.3802933532110759 1.218748621553019 2.4131201645880083 1.2301124557981211 2.4484648486377409 1.2410185778385312 2.4865379558141285 1.2514061092088014 2.5275387681122083 1.2612048590372069 2.5716342164919297 1.2703345468889893 2.6188961562909014 1.2787064791426241 2.6944197078699692 1.2899932287676368 2.7203660020806208 1.2935436203994546 2.7470741618592456 1.2968709422220499 2.7745248636991846 1.299963921273843 2.8026876894832782 1.3028114388165548 2.8315196712958501 1.3054028449586115 2.8609647666371871 1.3077283202932279 2.9209451675178415 1.311830144829347 2.9514804749107011 1.3136064938026784 2.9824928618276374 1.3150996471024854 3.0139023828162408 1.316302153734398 3.0456180447602463 1.3172080982415011 3.0775406249837278 1.3178134135365576 3.1095666382229936 1.318116071652818 3.1415926535897927 1.318116071652818 + 0 9 0.098174770424679203 7 0.19481556006147327 7 0.2899463373601896 7 0.47723505516703246 7 0.65867100054241789 7 1.0102031447072282 7 1.3397645298617404 7 1.9576921270264513 7 2.2280354507860118 7 2.4814823168105962 7 2.7190887537086437 7 2.8304667710046085 7 2.9383642252600772 7 3.0428898840700627 7 3.1441491160422359 7 3.2422439970152781 7 3.3372734129579111 7 3.5213929063467635 7 3.6940049313988133 7 4.0176524783714047 7 4.3008440819724241 7 4.7964293882742082 7 5.1681183680005462 7 5.4468851027953011 7 5.6559601538913684 7 5.8127664422134275 7 5.9303711584549701 7 6.0185746956361248 7 6.1508800014078568 7 6.2170326542937238 7 6.2831853071795862 9 +2 0 0 1 0 -0 1 96.824583655185421 +7 0 0 8 219 32 3.1415926535897931 1.318116071652818 3.1891213099488587 1.318116071652818 3.2366499663448849 1.3174494833264134 3.283840502917883 1.3161163110075904 3.3303548257263174 1.3141263873985736 3.3758846467371768 1.3114994674115223 3.4201823689259072 1.3082631680535997 3.463064495965531 1.3044498869759045 3.5451024940117137 1.2958072286237334 3.5843061322988525 1.2909946597522894 3.6218984793871414 1.2856901079814094 3.6578162828468521 1.2799292323119857 3.6920457213965392 1.2737477631992462 3.7246093437545147 1.2671800055047839 3.75555256992571 1.2602580385124882 3.8138606064339315 1.2458781937786021 3.8412737614369821 1.2384303782200674 3.8672334472503991 1.2306963236747492 3.8918115507606217 1.2227019751475154 3.9150857788521591 1.2144707144524247 3.9371346937574891 1.2060234595452157 3.9580350162802627 1.1973789159101054 4.0168910226981032 1.17117933017418 4.0517546108994793 1.1531049439456638 4.0830115225417103 1.1344581639227727 4.1111724191687244 1.1153365619647957 4.1366571473081422 1.0958151337767958 4.1598172185576914 1.0759534236665331 4.1809442334757989 1.0557991791805552 4.2190174218057646 1.0156213507107801 4.2360736023371768 0.99561336494835673 4.2516740356729201 0.97540287330935627 4.2659994988318886 0.95501757262246656 4.2791988878059612 0.93447979712628637 4.2913965356754638 0.91380795348557298 4.3026974952544137 0.89301739534788571 4.3335229671191993 0.83163458607718899 4.3508245879661445 0.79075119916035419 4.3657471617079864 0.74956544548740567 4.3787234456649458 0.70813850634613118 4.3900714888695802 0.66651572856017083 4.400029979802639 0.62473128452825222 4.4087840046276643 0.58281227803808933 4.4236922659335693 0.50137587782305948 4.4299748034643791 0.46187213161851814 4.4354457048505225 0.42228738235921703 4.4401938609332774 0.38263570586484263 4.4442875949010272 0.34292868825218292 4.447780006582839 0.30317622021793889 4.4507117173270245 0.2633869445400418 4.4576157339459836 0.14890944427676123 4.4602539472543867 0.074148304296457468 4.4612279224711529 -0.00066322955666464622 4.4606097123942163 -0.075483853137257029 4.4583886929503933 -0.15027424510896026 4.4544622265430007 -0.22499221660584112 4.4486282191598399 -0.29958848108010311 4.4369250993772287 -0.40654316335934532 4.4329216496968531 -0.43905764528812774 4.4284430709445246 -0.47152920851099012 4.4234486499040031 -0.5039510729812946 4.4178886880104642 -0.53631537877864588 4.4117023380737805 -0.56861286962130964 4.404813926294568 -0.60083235761564235 4.389919804360277 -0.66307926085728275 4.3820108374212134 -0.69311782447583636 4.373319908597594 -0.72306389209570199 4.3637509684781435 -0.75290369182835093 4.3531865630855577 -0.78262045993617591 4.3414815644048534 -0.81219354744094452 4.3284520831798456 -0.8415967000947322 4.3001718473390049 -0.8981679570487664 4.2851108206559729 -0.92536089414829803 4.2684730061100709 -0.95234460739857241 4.2500137492716021 -0.97908320855367492 4.2294275083841057 -1.0055314144151453 4.2063294655881691 -1.0316306005208844 4.1802169017730195 -1.0573025572614343 4.1364656067734833 -1.0942169225376597 4.1216948114604417 -1.1058797203276032 4.1060483397781127 -1.1174126479505162 4.0894504644143126 -1.1288026054403986 4.071817081733883 -1.1400345795056239 4.0530547545792421 -1.1510912445303951 4.0330604893159574 -1.1619524819253098 3.9910527585524269 -1.1829046130948553 3.969121920513524 -1.193008972867653 3.9458297650713234 -1.2028865932009865 3.9210682785644622 -1.2125131986866791 3.8947238933490667 -1.2218611607241101 3.86668058423286 -1.2308989539559518 3.8368271055429277 -1.2395908281888357 3.774307120468523 -1.2559437155329225 3.7417576738043863 -1.2636284553476571 3.7073384517625527 -1.2709151657304574 3.6709817421069602 -1.2777642398732496 3.6326481186861201 -1.2841328896729465 3.5923427335001179 -1.2899758909156844 3.5501385467876956 -1.2952478959044091 3.4636029923086014 -1.3044199217298862 3.4193793156700849 -1.3083576689796246 3.3736478742412146 -1.3116815687690178 3.3266101719600556 -1.3143560327162049 3.278540482331664 -1.3163508868656209 3.2297819383425121 -1.3176450231551371 3.1807088008447471 -1.3182287324338826 3.0842066816157758 -1.3179820157598279 3.0367742431330953 -1.3171952116246075 2.9897316235437756 -1.3157442870842715 2.9434128012235306 -1.3136403147764213 2.8981189220703527 -1.3109041085426725 2.8540890216308981 -1.307564032139453 2.81149815169023 -1.3036529401816563 2.7307105570501253 -1.2948979341360871 2.6924180962717741 -1.2900869908879655 2.6556921588860405 -1.2848050412201601 2.62058760272987 -1.2790860135365278 2.5871141319205293 -1.2729637724206739 2.5552483125006811 -1.2664707868283771 2.5249457786091556 -1.2596374255625258 2.4403527467387045 -1.2386470472992828 2.390206637561505 -1.2236299801575115 2.3452861969080914 -1.2076447550934972 2.3049734520118363 -1.190862792705957 2.2686825286382373 -1.1734164847898683 2.2358981528436743 -1.155411519389645 2.2061757480588908 -1.1369319699122957 2.1537876259299567 -1.1003403403166565 2.1307969708076842 -1.0822774760161311 2.1098525687595568 -1.0639134877887457 2.0906932187085658 -1.0452920432221049 2.0731021746796898 -1.0264480114881209 2.0568984440663258 -1.0074098238642586 2.0419287412504947 -0.98820098823095659 2.002064524380077 -0.93254159173909879 1.9799469356460122 -0.89571128789293653 1.9608517267979551 -0.85848007394633896 1.9442027991681243 -0.82093064766513635 1.9295797175318512 -0.78312341069204194 1.9166656051131667 -0.74510326298991458 1.9052149381818488 -0.70690528898314686 1.8861257435647465 -0.63500290105157375 1.8781896108382485 -0.60133363769516635 1.8710959103499576 -0.56756822949644992 1.8647451683623331 -0.53372118624935183 1.8590584296185 -0.49980430459196157 1.8539718014013316 -0.46582746172684131 1.8494333836375589 -0.43179905863243201 1.8383434854690126 -0.33809929249123988 1.8328350757269618 -0.27833668499869191 1.8286479412836343 -0.21847780260173977 1.8256435585572035 -0.15855161481169944 1.8237351585430588 -0.098582494983133984 1.8228786252625468 -0.038592237062601953 1.8230666341883606 0.021398018221502071 1.8252840508978476 0.12634158855163929 1.8268413513516033 0.17130474812742644 1.8290202320588733 0.2162457530765769 1.8318483639408214 0.26115468578822743 1.8353679958926676 0.30602065695819114 1.8396382265475535 0.35083128888889115 1.8447403258090465 0.39557185146545515 1.8553244424423214 0.47371252997231134 1.8603925985951262 0.50715147263850258 1.8660410433341426 0.5405326088661937 1.8723283000055062 0.57384681332510468 1.8793262039381204 0.60708327134540596 1.8871234218434125 0.64022897629126629 1.8958317267540097 0.67326781305587247 1.9129213674028811 0.73086215488403572 1.9208401773860204 0.75547356560545242 1.9294153342174738 0.78000426768976894 1.9387193720097002 0.80444391737989918 1.9488385877810401 0.82878019900115163 1.9598767187021684 0.85299827711218867 1.9719607258979133 0.87707986520084191 1.995216975664132 0.91894293111987024 2.0058619131433297 0.93679433321874861 2.0172520595010162 0.95454599031408172 2.0294649827445053 0.97218641536931016 2.0425906828789859 0.9897021638703174 2.0567345774110617 1.0070772619615249 2.0720213727804566 1.0242923662962062 2.1010336584244649 1.0540971225796323 2.1141940524356762 1.0667671912579313 2.1281437491697162 1.079323803863101 2.1429531400816586 1.0917554662818816 2.1587012616880372 1.1040489601357635 2.1754771599594824 1.1161889657334907 2.1933809907690289 1.1281575742817493 2.2268816543162151 1.1487657378247886 2.2419362466376858 1.1574895181439673 2.2577350227699498 1.1660961002298293 2.2743285796004784 1.1745755590748672 2.2917710616558651 1.1829168130794798 2.3101199924401845 1.191107452213656 2.3294355232708965 1.1991335640122511 2.3802933532110759 1.218748621553019 2.4131201645880083 1.2301124557981211 2.4484648486377409 1.2410185778385312 2.4865379558141285 1.2514061092088014 2.5275387681122083 1.2612048590372069 2.5716342164919297 1.2703345468889893 2.6188961562909014 1.2787064791426241 2.6944197078699692 1.2899932287676368 2.7203660020806208 1.2935436203994546 2.7470741618592456 1.2968709422220499 2.7745248636991846 1.299963921273843 2.8026876894832782 1.3028114388165548 2.8315196712958501 1.3054028449586115 2.8609647666371871 1.3077283202932279 2.9209451675178415 1.311830144829347 2.9514804749107011 1.3136064938026784 2.9824928618276374 1.3150996471024854 3.0139023828162408 1.316302153734398 3.0456180447602463 1.3172080982415011 3.0775406249837278 1.3178134135365576 3.1095666382229936 1.318116071652818 3.1415926535897927 1.318116071652818 + 0 9 0.098174770424679203 7 0.19481556006147327 7 0.2899463373601896 7 0.47723505516703246 7 0.65867100054241789 7 1.0102031447072282 7 1.3397645298617404 7 1.9576921270264513 7 2.2280354507860118 7 2.4814823168105962 7 2.7190887537086437 7 2.8304667710046085 7 2.9383642252600772 7 3.0428898840700627 7 3.1441491160422359 7 3.2422439970152781 7 3.3372734129579111 7 3.5213929063467635 7 3.6940049313988133 7 4.0176524783714047 7 4.3008440819724241 7 4.7964293882742082 7 5.1681183680005462 7 5.4468851027953011 7 5.6559601538913684 7 5.8127664422134275 7 5.9303711584549701 7 6.0185746956361248 7 6.1508800014078568 7 6.2170326542937238 7 6.2831853071795862 9 +2 0 0 1 0 -0 1 96.824583655185421 +Curves 2 +8 0 2.1362830044410597 +2 -25 0 0 1 0 0 -0 0 1 0 -1 0 96.824583655185421 +8 2.1362830044410597 6.2831853071795862 +2 -25 0 0 1 0 0 -0 0 1 0 -1 0 96.824583655185421 +Polygon3D 2 +14 1 +0.774596670041483 +-25 0 96.8245836551854 -25 -15.839617200244 95.520189106543 -25 -31.2524603406654 91.6421503602744 -25 -45.8232541303722 85.2949551902299 -25 -59.1594109997371 76.6496189825115 -25 -70.9016087670672 65.9390769896102 -25 -80.7334720206937 53.4519082492278 -25 -88.3900963665694 39.5245602671122 -25 -93.6651858686676 24.5322839578372 -25 -96.4166113748581 8.87902308756872 -25 -96.5702399677396 -7.01346936780919 -25 -94.1219323617811 -22.7169947062611 -25 -89.1376544299886 -37.8084456533185 -25 -81.751699855179 -51.8812063351338 +0 0.164329461880082 0.328658923760163 0.492988385640245 0.657317847520326 0.821647309400408 0.985976771280489 1.15030623316057 1.31463569504065 1.47896515692073 1.64329461880081 1.8076240806809 1.97195354256098 2.13628300444106 +25 1 +0.774596670041483 +-25 -81.751699855179 -51.8812063351338 -25 -71.6144728297328 -65.1641564153137 -25 -59.3444702892758 -76.5064300963341 -25 -45.3071094456283 -85.5702391821004 -25 -29.9204418227311 -92.0856512228293 -25 -13.6427031188592 -95.8586284671895 -25 3.04133367003308 -96.7768065680384 -25 19.6347954434554 -94.812840944113 -25 35.6435065469453 -90.0252211385113 -25 50.5907059890537 -82.5565289212739 -25 64.0312460261966 -72.6291920121151 -25 75.5648492623805 -60.5388598831669 -25 84.8480294495048 -46.6455989192545 -25 91.6043209707437 -31.3631691556985 -25 95.6325123592052 -15.1467019468421 -25 96.8126386465856 1.52085445905681 -25 95.109554081602 18.143117769524 -25 90.5739788178304 34.2250545815082 -25 83.3409883991773 49.2877231432757 -25 73.6259910281423 62.8825368852427 -25 61.7183124192442 74.6046239325725 -25 47.9725792893206 84.104884735251 -25 32.7981580959739 91.1003887231635 -25 16.6469635527646 95.3828003597762 -25 0 96.8245836551854 +2.13628300444106 2.3090706003885 2.48185819633594 2.65464579228338 2.82743338823081 3.00022098417825 3.17300858012569 3.34579617607313 3.51858377202057 3.69137136796801 3.86415896391544 4.03694655986288 4.20973415581032 4.38252175175776 4.5553093477052 4.72809694365264 4.90088453960008 5.07367213554751 5.24645973149495 5.41924732744239 5.59203492338983 5.76482251933727 5.93761011528471 6.11039771123215 6.28318530717959 +PolygonOnTriangulations 2 +14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 +p 0.774596670041483 1 0 0.164329461880082 0.328658923760163 0.492988385640245 0.657317847520326 0.821647309400408 0.985976771280489 1.15030623316057 1.31463569504065 1.47896515692073 1.64329461880081 1.8076240806809 1.97195354256098 2.13628300444106 +25 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 1 +p 0.774596670041483 1 2.13628300444106 2.3090706003885 2.48185819633594 2.65464579228338 2.82743338823081 3.00022098417825 3.17300858012569 3.34579617607313 3.51858377202057 3.69137136796801 3.86415896391544 4.03694655986288 4.20973415581032 4.38252175175776 4.5553093477052 4.72809694365264 4.90088453960008 5.07367213554751 5.24645973149495 5.41924732744239 5.59203492338983 5.76482251933727 5.93761011528471 6.11039771123215 6.28318530717959 +Surfaces 2 +1 0 0 0 1 0 0 -0 0 1 0 -1 0 +4 0 0 0 0 0 1 1 0 -0 -0 1 0 100 +Triangulations 1 +37 35 1 0.774596670041483 +-25 0 96.8245836551854 -25 -15.839617200244 95.520189106543 -25 -31.2524603406654 91.6421503602744 -25 -45.8232541303722 85.2949551902299 -25 -59.1594109997371 76.6496189825115 -25 -70.9016087670672 65.9390769896102 -25 -80.7334720206937 53.4519082492278 -25 -88.3900963665694 39.5245602671122 -25 -93.6651858686676 24.5322839578372 -25 -96.4166113748581 8.87902308756872 -25 -96.5702399677396 -7.01346936780919 -25 -94.1219323617811 -22.7169947062611 -25 -89.1376544299886 -37.8084456533185 -25 -81.751699855179 -51.8812063351338 -25 -71.6144728297328 -65.1641564153137 -25 -59.3444702892758 -76.5064300963341 -25 -45.3071094456283 -85.5702391821004 -25 -29.9204418227311 -92.0856512228293 -25 -13.6427031188592 -95.8586284671895 -25 3.04133367003308 -96.7768065680384 -25 19.6347954434554 -94.812840944113 -25 35.6435065469453 -90.0252211385113 -25 50.5907059890537 -82.5565289212739 -25 64.0312460261966 -72.6291920121151 -25 75.5648492623805 -60.5388598831669 -25 84.8480294495048 -46.6455989192545 -25 91.6043209707437 -31.3631691556985 -25 95.6325123592052 -15.1467019468421 -25 96.8126386465856 1.52085445905681 -25 95.109554081602 18.143117769524 -25 90.5739788178304 34.2250545815082 -25 83.3409883991773 49.2877231432757 -25 73.6259910281423 62.8825368852427 -25 61.7183124192442 74.6046239325725 -25 47.9725792893206 84.104884735251 -25 32.7981580959739 91.1003887231635 -25 16.6469635527646 95.3828003597762 96.8245836551854 0 95.520189106543 15.839617200244 91.6421503602744 31.2524603406654 85.2949551902299 45.8232541303722 76.6496189825115 59.1594109997371 65.9390769896102 70.9016087670672 53.4519082492278 80.7334720206937 39.5245602671122 88.3900963665694 24.5322839578372 93.6651858686675 8.87902308756873 96.4166113748581 -7.01346936780919 96.5702399677396 -22.7169947062611 94.1219323617811 -37.8084456533185 89.1376544299886 -51.8812063351338 81.751699855179 -65.1641564153137 71.6144728297328 -76.5064300963341 59.3444702892758 -85.5702391821004 45.3071094456283 -92.0856512228293 29.9204418227311 -95.8586284671895 13.6427031188592 -96.7768065680384 -3.04133367003308 -94.812840944113 -19.6347954434554 -90.0252211385113 -35.6435065469453 -82.5565289212739 -50.5907059890537 -72.6291920121151 -64.0312460261966 -60.5388598831669 -75.5648492623805 -46.6455989192545 -84.8480294495048 -31.3631691556985 -91.6043209707437 -15.1467019468421 -95.6325123592052 1.52085445905681 -96.8126386465856 18.143117769524 -95.109554081602 34.2250545815082 -90.5739788178304 49.2877231432757 -83.3409883991773 62.8825368852426 -73.6259910281423 74.6046239325725 -61.7183124192442 84.104884735251 -47.9725792893206 91.1003887231635 -32.7981580959739 95.3828003597762 -16.6469635527646 23 24 25 22 23 25 27 25 26 27 22 25 21 22 27 20 21 27 19 20 27 30 28 29 16 17 18 33 18 19 33 27 28 33 30 31 33 31 32 33 19 27 33 28 30 15 16 18 15 18 33 34 15 33 13 14 15 36 34 35 37 15 34 37 34 36 10 11 12 10 12 13 9 13 15 9 10 13 9 15 37 3 1 2 4 37 1 4 1 3 4 9 37 6 9 4 6 4 5 6 7 8 6 8 9 + +TShapes 6 +Ve +1.00000023715183e-07 +-25 0 96.8245836551854 +0 0 + +0101101 +* +Ve +1e-07 +-25 -81.751699855179 -51.8812063351338 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 1 0 0 2.13628300444106 +2 1 2 0 0 2.13628300444106 +2 2 1 1 0 2.13628300444106 +5 1 0 +6 1 1 0 +0 + +0101000 ++6 0 -5 0 * +Ed + 1e-07 1 1 0 +1 2 0 2.13628300444106 6.28318530717959 +2 3 2 0 2.13628300444106 6.28318530717959 +2 4 1 1 2.13628300444106 6.28318530717959 +5 2 0 +6 2 1 0 +0 + +0101000 ++5 0 -6 0 * +Wi + +0101100 ++4 0 +3 0 * +Fa +0 1e-07 1 1 +2 1 +0101000 ++2 0 * + ++1 0 \ No newline at end of file diff --git a/test/data/WrappedFace_sphere_vertices.brep b/test/data/WrappedFace_sphere_vertices.brep new file mode 100755 index 000000000..8bda63831 --- /dev/null +++ b/test/data/WrappedFace_sphere_vertices.brep @@ -0,0 +1,53 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 0 +Curve2ds 0 +Curves 0 +Polygon3D 0 +PolygonOnTriangulations 0 +Surfaces 0 +Triangulations 0 + +TShapes 6 +Ve +1e-07 +-98.2778854144335 12.9942378002121 13.1379991802029 +0 0 + +0101101 +* +Ve +1e-07 +-62.4980389121083 48.4176397451153 61.2350168910961 +0 0 + +0101101 +* +Ve +1e-07 +-91.4519040662823 -38.2576611431453 -13.1491675214732 +0 0 + +0101101 +* +Ve +1e-07 +-78.3669668760696 -10.4350950638792 61.2350168910961 +0 0 + +0101101 +* +Ve +1e-07 +-85.1638454334068 35.5349860871206 -38.5277068456318 +0 0 + +0101101 +* +Co + +1100000 ++6 0 +5 0 +4 0 +3 0 +2 0 * + ++1 0 diff --git a/test/test_WrappedFace.py b/test/test_WrappedFace.py new file mode 100755 index 000000000..bdb203212 --- /dev/null +++ b/test/test_WrappedFace.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +import sys +import salome +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +import math +from inspect import getfile +from os.path import abspath, dirname, join +import SALOMEDS + +geompy = geomBuilder.New() + +data_dir = abspath(join(dirname(getfile(lambda: None)), 'data')) + +myInitFace = geompy.ImportBREP(join(data_dir, 'WrappedFace_sphere_face.brep')) +listE = geompy.ExtractShapes(myInitFace, geompy.ShapeType["EDGE"], True) + +myVertices = geompy.ImportBREP(join(data_dir, 'WrappedFace_sphere_vertices.brep')) +lVertices = geompy.SubShapeAll(myVertices, geompy.ShapeType["VERTEX"]) + +wrappedFaceSphere = geompy.MakeWrappedFace(listE, lVertices, 0.01) +wrappedAreaSphere = geompy.BasicProperties(wrappedFaceSphere)[1] + +eps = 1e-5 +expectedArea = 47123.88980388897 +print(wrappedAreaSphere) +assert(math.fabs(expectedArea - wrappedAreaSphere) < eps) + +########################################################################### + +myEdges = geompy.ImportBREP(join(data_dir, 'WrappedFace_bspline_edges.brep')) +listE2 = geompy.ExtractShapes(myEdges, geompy.ShapeType["EDGE"], True) + +myVertices2 = geompy.ImportBREP(join(data_dir, 'WrappedFace_bspline_vertices.brep')) +lVertices2 = geompy.SubShapeAll(myVertices2, geompy.ShapeType["VERTEX"]) + +wrappedFace = geompy.MakeWrappedFace(listE2, lVertices2, 0.01) +wrappedArea = geompy.BasicProperties(wrappedFace)[1] + +expectedArea = 15702.653817260858 +print(wrappedArea) +assert(math.fabs(expectedArea - wrappedArea) < eps) + + diff --git a/test/test_wire_modes.py b/test/test_wire_modes.py new file mode 100644 index 000000000..31614fa42 --- /dev/null +++ b/test/test_wire_modes.py @@ -0,0 +1,310 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2022 CEA/DEN, EDF R&D, 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 salome +salome.salome_init() + +import GEOM +from salome.geom import geomBuilder +import math +geompy = geomBuilder.New() + +# gaps and tolerances +halfGap = math.sqrt(2.0) / 2.0 # dx = 1 and dy = 1 +tol = 3.0 # max. gap to be closed +prec = 1e-4 # precision of comparison + +# prepare edges +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(100, 0, 0) +Vertex_3 = geompy.MakeVertex(100, 70, 0) +Vertex_4 = geompy.MakeVertex(0, 70, 0) +Vertex_5 = geompy.MakeVertex(60, 60, 0) +Vertex_6 = geompy.MakeVertex(10, 50, 0) +Vertex_7 = geompy.MakeVertex(20, 0, 0) +Vertex_8 = geompy.MakeVertex(15, 80, 0) +Vertex_9 = geompy.MakeVertex(35, 60, 0) +Vertex_10 = geompy.MakeVertex(-20, 80, 0) +Vertex_11 = geompy.MakeVertex(10, -10, 0) +Vertex_12 = geompy.MakeVertex(10, 20, 0) +Vertex_13 = geompy.MakeVertex(-10, 30, 0) +Vertex_14 = geompy.MakeVertex(-20, 0, 0) +Vertex_15 = geompy.MakeVertex(-10, -10, 0) + +# Linear segments +Curve_1 = geompy.MakePolyline([O, Vertex_2, Vertex_3, Vertex_4], True) + +# Circles +Circle_1 = geompy.MakeCircle(Vertex_3, None, 10) +Circle_2 = geompy.MakeCircle(Vertex_5, None, 15) + +# Ellipses +geomObj_1 = geompy.MakeEllipse(O, None, 30, 10) +geomObj_2 = geompy.MakeRotation(geomObj_1, OZ, 45*math.pi/180.0) +Translation_1 = geompy.MakeTranslation(geomObj_2, 100, 0, 0) +geomObj_3 = geompy.MakeEllipse(None, None, 20, 10) +geomObj_4 = geompy.MakeRotation(geomObj_3, OZ, 90*math.pi/180.0) +Translation_2 = geompy.MakeTranslation(geomObj_4, 50, 10, 0) + +# Closed B-Spline curve +Curve_2 = geompy.MakeInterpol([Vertex_1, Vertex_6, Vertex_10, Vertex_8], True, False) + +# Closed Bezier curve +Curve_4 = geompy.MakeBezier([Vertex_7, Vertex_12, Vertex_13, Vertex_14, Vertex_15, Vertex_11], True) + +# Partition +Partition_1 = geompy.MakePartition([Circle_1, Circle_2, Curve_1, Curve_2, Translation_1, Translation_2, Curve_4], [], [], [], geompy.ShapeType["EDGE"], 0, [], 0) + +[Edge_1,Edge_2,Edge_3,Edge_4,Edge_5,Edge_6,Edge_7,Edge_8,Edge_9,Edge_10,Edge_11,Edge_12,Edge_13,Edge_14,Edge_15,Edge_16,Edge_17,Edge_18,Edge_19,Edge_20,Edge_21,Edge_22,Edge_23,Edge_24,Edge_25,Edge_26,Edge_27,Edge_28,Edge_29,Edge_30,Edge_31,Edge_32] = geompy.ExtractShapes(Partition_1, geompy.ShapeType["FLAT"], True) + +# FuseCollinearEdges +Wire_1 = geompy.MakeWire([Edge_16, Edge_20], 1e-07) +Wire_2 = geompy.MakeWire([Edge_30, Edge_32], 1e-07) +Wire_3 = geompy.MakeWire([Edge_24, Edge_31], 1e-07) +Wire_4 = geompy.MakeWire([Edge_11, Edge_15], 1e-07) + +FuseEdges_1 = geompy.FuseCollinearEdgesWithinWire(Wire_1, []) +[Edge_33] = geompy.ExtractShapes(FuseEdges_1, geompy.ShapeType["EDGE"], True) +FuseEdges_2 = geompy.FuseCollinearEdgesWithinWire(Wire_2, []) +[Edge_34] = geompy.ExtractShapes(FuseEdges_2, geompy.ShapeType["EDGE"], True) +FuseEdges_3 = geompy.FuseCollinearEdgesWithinWire(Wire_3, []) +[Edge_35] = geompy.ExtractShapes(FuseEdges_3, geompy.ShapeType["EDGE"], True) +FuseEdges_4 = geompy.FuseCollinearEdgesWithinWire(Wire_4, []) +[Edge_36] = geompy.ExtractShapes(FuseEdges_4, geompy.ShapeType["EDGE"], True) + +# Make gaps +Translation_3 = geompy.MakeTranslation(Edge_2, -1, -1, 0) # closed bezier outer part +Translation_4 = geompy.MakeTranslation(Edge_5, -1, 1, 0) # closed b-spline outer part +Translation_5 = geompy.MakeTranslation(Edge_18, 0, 1, 0) +Translation_6 = geompy.MakeTranslation(Edge_34, 1, 1, 0) +Translation_7 = geompy.MakeTranslation(Edge_35, 1, -1, 0) +Translation_8 = geompy.MakeTranslation(Edge_13, 0, -1, 0) + +Translation_9 = geompy.MakeTranslation(Edge_7, 1, 1, 0) # closed bezier inner part +Translation_10 = geompy.MakeTranslation(Edge_9, 1, -1, 0) # closed b-spline inner part +Translation_11 = geompy.MakeTranslation(Edge_33, 0, -1, 0) +Translation_12 = geompy.MakeTranslation(Edge_25, -1, -1, 0) +Translation_13 = geompy.MakeTranslation(Edge_23, -1, 1, 0) +Translation_14 = geompy.MakeTranslation(Edge_36, 0, 1, 0) + +# Not closed B-Spline and Bezier curves +translated_vertex_3 = geompy.GetSubShape(Translation_3, [3]) +translated_vertex_2 = geompy.GetSubShape(Translation_3, [2]) +Curve_1 = geompy.MakeBezier([translated_vertex_3, Vertex_11, Vertex_15, Vertex_14, translated_vertex_2], False) + +translated_vertex_2_1 = geompy.GetSubShape(Translation_9, [2]) +translated_vertex_3_1 = geompy.GetSubShape(Translation_9, [3]) +Curve_2 = geompy.MakeBezier([translated_vertex_2_1, Vertex_12, translated_vertex_3_1], False) + +translated_vertex_2_2 = geompy.GetSubShape(Translation_4, [2]) +translated_vertex_3_2 = geompy.GetSubShape(Translation_4, [3]) +Curve_3 = geompy.MakeInterpol([translated_vertex_2_2, Vertex_10, Vertex_8, translated_vertex_3_2], False, False) + +translated_vertex_2_3 = geompy.GetSubShape(Translation_10, [2]) +translated_vertex_3_3 = geompy.GetSubShape(Translation_10, [3]) +Curve_4 = geompy.MakeInterpol([translated_vertex_2_3, Vertex_9, Vertex_6, translated_vertex_3_3], False, False) + +# Make wires with different methods + +########################################################### +### Use case 1. With pieces of closed Beziers and B_Splines +### +### MakeWire() works good +### MakeWireConstCurveType() raises exception, +### as pieces of Beziers and B_Splines are not supported now +### MakeWireWithMode(GEOM.WBM_Approximation) gives wrong result, +### as pieces of closed bezier curve are wrongly treated +########################################################### + +# add to study argument edges +edges_outer_1 = [Translation_3, Translation_4, Translation_5, Translation_6, Translation_7, Translation_8, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28] + +edges_inner_1 = [Translation_9, Translation_10, Translation_11, Translation_12, Translation_13, Translation_14, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28] + +edges_outer_1_folder = geompy.NewFolder('edges_outer_1') +edges_inner_1_folder = geompy.NewFolder('edges_inner_1') + +ii = 1 +for ee in edges_outer_1: + geompy.addToStudy(ee, "edge_outer_1_%d"%ii) + geompy.PutToFolder(ee, edges_outer_1_folder) + ii += 1 + pass +ii = 1 +for ee in edges_inner_1: + geompy.addToStudy(ee, "edge_inner_1_%d"%ii) + geompy.PutToFolder(ee, edges_inner_1_folder) + ii += 1 + pass + +# a. Old implementation (FixTolerance) +Wire_FixTolerance_Outer_1 = geompy.MakeWire(edges_outer_1, tol, 'Wire_FixTolerance_Outer_1') +Wire_FixTolerance_Inner_1 = geompy.MakeWire(edges_inner_1, tol, 'Wire_FixTolerance_Inner_1') + +# b. New implementation (ConstCurveType) + +# b.1. Not supported case: +# Errors because of not supported Bezier and B-Spline +# (Ends of edge do not correspond to first and last poles) +# +#Wire_ConstCurveType_Outer_1 = geompy.MakeWireConstCurveType(edges_outer_1, tol, 'Wire_ConstCurveType_Outer_1') +#Wire_ConstCurveType_Inner_1 = geompy.MakeWireConstCurveType(edges_inner_1, tol, 'Wire_ConstCurveType_Inner_1') +# +try: + Wire_ConstCurveType_BezierOnly = geompy.MakeWireConstCurveType([Edge_1, Edge_6, Translation_4, Translation_5, Translation_6, Translation_7, Translation_8, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28], tol, 'Wire_ConstCurveType_BezierOnly') +except: + print("KNOWN PROBLEM: MakeWireConstCurveType doesn't support pieces of Bezier curves") +else: + assert(False), "MakeWireConstCurveType should fail here" + pass +# +try: + Wire_ConstCurveType_BSplineOnly = geompy.MakeWireConstCurveType([Translation_9, Edge_4, Edge_8, Translation_11, Translation_12, Translation_13, Translation_14, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28], tol, 'Wire_ConstCurveType_BSplineOnly') +except: + print("KNOWN PROBLEM: MakeWireConstCurveType doesn't support pieces of BSpline curves") +else: + assert(False), "MakeWireConstCurveType should fail here" + pass + +# c. Approximation mode (canonical curves are approximated with b-splines) +Wire_Approximation_Outer_1 = geompy.MakeWireWithMode(edges_outer_1, tol, GEOM.WBM_Approximation, 'Wire_Approximation_Outer_1') +Wire_Approximation_Inner_1 = geompy.MakeWireWithMode(edges_inner_1, tol, GEOM.WBM_Approximation, 'Wire_Approximation_Inner_1') + +### check tolerances +# +tol_FO1 = geompy.Tolerance(Wire_FixTolerance_Outer_1)[5] +tol_FI1 = geompy.Tolerance(Wire_FixTolerance_Inner_1)[5] +assert(abs(tol_FO1 - halfGap) < prec) +assert(abs(tol_FI1 - halfGap) < prec) +# +### Not supported case +#tol_CO1 = geompy.Tolerance(Wire_ConstCurveType_Outer_1)[5] +#tol_CI1 = geompy.Tolerance(Wire_ConstCurveType_Inner_1)[5] +#assert(tol_CO1 < prec) +#assert(tol_CI1 < prec) +# +tol_AO1 = geompy.Tolerance(Wire_Approximation_Outer_1)[5] +tol_AI1 = geompy.Tolerance(Wire_Approximation_Inner_1)[5] +assert(tol_AO1 < prec) +assert(tol_AI1 < prec) + +### check wire length +# +Length_FO1 = geompy.BasicProperties( Wire_FixTolerance_Outer_1 )[0] +Length_FI1 = geompy.BasicProperties( Wire_FixTolerance_Inner_1 )[0] +assert(abs(Length_FO1 - 530.13081) < prec) +assert(abs(Length_FI1 - 415.46762) < prec) +# +### Not supported case +#Length_CO1 = geompy.BasicProperties( Wire_ConstCurveType_Outer_1 )[0] +#Length_CI1 = geompy.BasicProperties( Wire_ConstCurveType_Inner_1 )[0] +#assert(abs(Length_CO1 - ) < prec) +#assert(abs(Length_CI1 - ) < prec) +# +# Here we have a problem with Approximation mode: pieces of bezier curve are wrongly treated +Length_AO1 = geompy.BasicProperties( Wire_Approximation_Outer_1 )[0] +Length_AI1 = geompy.BasicProperties( Wire_Approximation_Inner_1 )[0] +#assert(math.abs(Length_AO1 - 514.35263) < prec) +#assert(math.abs(Length_AI1 - 437.69903) < prec) +if Length_AO1 < 520.0 or Length_AI1 > 425.0: + print("KNOWN PROBLEM: MakeWireWithMode(GEOM.WBM_Approximation) error: pieces of closed bezier curve are wrongly treated") + pass + +############################################################## +### Use case 2. With entire Beziers and B_Splines (not closed) +### +### All three methods give good results +############################################################## + +# add to study argument edges +edges_outer_2 = [Curve_1, Curve_3, Translation_5, Translation_6, Translation_7, Translation_8, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28] + +edges_inner_2 = [Curve_2, Curve_4, Translation_11, Translation_12, Translation_13, Translation_14, Edge_3, Edge_10, Edge_12, Edge_19, Edge_21, Edge_28] + +edges_outer_2_folder = geompy.NewFolder('edges_outer_2') +edges_inner_2_folder = geompy.NewFolder('edges_inner_2') + +ii = 1 +for ee in edges_outer_2: + geompy.addToStudy(ee, "edge_outer_2_%d"%ii) + geompy.PutToFolder(ee, edges_outer_2_folder) + ii += 1 + pass +ii = 1 +for ee in edges_inner_2: + geompy.addToStudy(ee, "edge_inner_2_%d"%ii) + geompy.PutToFolder(ee, edges_inner_2_folder) + ii += 1 + pass + +# a. Old implementation (FixTolerance) +Wire_FixTolerance_Outer_2 = geompy.MakeWire(edges_outer_2, tol, 'Wire_FixTolerance_Outer_2') +Wire_FixTolerance_Inner_2 = geompy.MakeWire(edges_inner_2, tol, 'Wire_FixTolerance_Inner_2') + +# b. New implementation (ConstCurveType) +Wire_ConstCurveType_Outer_2 = geompy.MakeWireConstCurveType(edges_outer_2, tol, 'Wire_ConstCurveType_Outer_2') +Wire_ConstCurveType_Inner_2 = geompy.MakeWireConstCurveType(edges_inner_2, tol, 'Wire_ConstCurveType_Inner_2') + +# c. Approximation mode (in case of need canonical curves are approximated with b-splines) +Wire_Approximation_Outer_2 = geompy.MakeWireWithMode(edges_outer_2, tol, GEOM.WBM_Approximation, 'Wire_Approximation_Outer_2') +Wire_Approximation_Inner_2 = geompy.MakeWireWithMode(edges_inner_2, tol, GEOM.WBM_Approximation, 'Wire_Approximation_Inner_2') + +### check tolerances +# +tol_FO2 = geompy.Tolerance(Wire_FixTolerance_Outer_2)[5] +tol_FI2 = geompy.Tolerance(Wire_FixTolerance_Inner_2)[5] +assert(abs(tol_FO2 - halfGap) < prec) +assert(abs(tol_FI2 - halfGap) < prec) +# +tol_CO2 = geompy.Tolerance(Wire_ConstCurveType_Outer_2)[5] +tol_CI2 = geompy.Tolerance(Wire_ConstCurveType_Inner_2)[5] +assert(tol_CO2 < prec) +assert(tol_CI2 < prec) +# +tol_AO2 = geompy.Tolerance(Wire_Approximation_Outer_2)[5] +tol_AI2 = geompy.Tolerance(Wire_Approximation_Inner_2)[5] +assert(tol_AO2 < prec) +assert(tol_AI2 < prec) + +### check wire length +# +Length_FO2 = geompy.BasicProperties( Wire_FixTolerance_Outer_2 )[0] +Length_FI2 = geompy.BasicProperties( Wire_FixTolerance_Inner_2 )[0] +assert(abs(Length_FO2 - 527.57476) < prec) +assert(abs(Length_FI2 - 421.28096) < prec) +# +Length_CO2 = geompy.BasicProperties( Wire_ConstCurveType_Outer_2 )[0] +Length_CI2 = geompy.BasicProperties( Wire_ConstCurveType_Inner_2 )[0] +assert(abs(Length_CO2 - 534.02648) < prec) +assert(abs(Length_CI2 - 418.95420) < prec) +# +Length_AO2 = geompy.BasicProperties( Wire_Approximation_Outer_2 )[0] +Length_AI2 = geompy.BasicProperties( Wire_Approximation_Inner_2 )[0] +assert(abs(Length_AO2 - 537.15192) < prec) +assert(abs(Length_AI2 - 422.09815) < prec) + + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser() diff --git a/test/tests.set b/test/tests.set index 5e264b447..417fe1771 100644 --- a/test/tests.set +++ b/test/tests.set @@ -31,5 +31,12 @@ IF(${OpenCASCADE_VERSION}.${OpenCASCADE_SP_VERSION} VERSION_GREATER "7.5.3.3") test_proximity_edge_edge.py test_proximity_face_face.py test_boolean_fuzzy.py + test_WrappedFace.py + ) +ENDIF() + +IF(${OpenCASCADE_VERSION}.${OpenCASCADE_SP_VERSION} VERSION_GREATER "7.5.3.5") + LIST(APPEND ALL_TESTS + test_wire_modes.py ) ENDIF()