X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBLSURFPlugin%2FBLSURFPluginBuilder.py;fp=src%2FBLSURFPlugin%2FBLSURFPluginBuilder.py;h=44a8a242918a6a6f56eef41e0702030934150e5d;hb=8385c8dc8bcbcb2630484016bc5e97e926f8f835;hp=36e522ef91f7a3d68711e017b3074d32315a9eba;hpb=209c7e2a0ca7a9323cc63e6b2ad5067b567534af;p=plugins%2Fblsurfplugin.git diff --git a/src/BLSURFPlugin/BLSURFPluginBuilder.py b/src/BLSURFPlugin/BLSURFPluginBuilder.py index 36e522e..44a8a24 100644 --- a/src/BLSURFPlugin/BLSURFPluginBuilder.py +++ b/src/BLSURFPlugin/BLSURFPluginBuilder.py @@ -199,6 +199,14 @@ class BLSURF_Algorithm(Mesh_Algorithm): self.Parameters().SetPreCADMergeEdges(toMergeEdges) pass + ## To remove duplicate CAD Faces + # @param toRemoveDuplicateCADFaces "merge edges" flag value + def SetPreCADRemoveDuplicateCADFaces(self, toRemoveDuplicateCADFaces=False): + if self.Parameters().GetTopology() != PreCAD: + self.SetTopology(PreCAD) + self.Parameters().SetPreCADRemoveDuplicateCADFaces(toRemoveDuplicateCADFaces) + pass + ## To process 3D topology. # @param toProcess "PreCAD process 3D" flag value def SetPreCADProcess3DTopology(self, toProcess=False): @@ -502,123 +510,6 @@ class BLSURF_Algorithm(Mesh_Algorithm): self.Parameters().AddPreCadEdgesPeriodicity(theEdge1, theEdge2) pass - - #----------------------------------------- - # Periodicity (BLSURF without PreCAD) - #----------------------------------------- - - - ## Defines periodicity between two faces, without using PreCAD. - # User has to call AddEdgePeriodicity with the edges of the face, - # and AddVertexPeriodicity with the vertices of each edge. - # @param theFace1 : GEOM face to associate with theFace2 - # @param theFace2 : GEOM face associated with theFace1 - def AddFacePeriodicity(self, theFace1, theFace2): - self.Parameters().AddFacePeriodicity(theFace1, theFace2) - pass - - ## Defines periodicity between two edges belonging to two periodic faces, without using PreCAD. - # To be used with AddFacePeriodicity. - # User has to call AddVertexPeriodicity with the vertices of each edge - # @param theFace1 : GEOM face to associate with theFace2 - # @param theEdge1 : GEOM edge to associate with theEdge2 - # @param theFace2 : GEOM face associated with theFace1 - # @param theEdge2 : GEOM edge associated with theEdge1 - # @param theEdgeOrientation : -1 (reversed), 0 (unknown) or 1 (forward) - def AddEdgePeriodicity(self, theFace1, theEdge1, theFace2, theEdge2, theEdgeOrientation=0): - self.Parameters().AddEdgePeriodicity(theFace1, theEdge1, theFace2, theEdge2, theEdgeOrientation) - pass - - ## Defines periodicity between two edges without face periodicity, without using PreCAD. - # User has to call AddVertexPeriodicity with the vertices of each edge. - # @param theEdge1 : GEOM edge to associate with theEdge2 - # @param theEdge2 : GEOM edge associated with theEdge1 - # @param theEdgeOrientation : -1 (reversed), 0 (unknown) or 1 (forward) - def AddEdgePeriodicityWithoutFaces(self, theEdge1, theEdge2, theEdgeOrientation=0): - self.Parameters().AddEdgePeriodicityWithoutFaces(theEdge1, theEdge2, theEdgeOrientation) - pass - - ## Defines periodicity between two vertices. - # To be used with AddFacePeriodicity and AddEdgePeriodicity. - # @param theEdge1 : GEOM edge to associate with theEdge2 - # @param theVertex1 : GEOM face to associate with theVertex2 - # @param theEdge2 : GEOM edge associated with theEdge1 - # @param theVertex2 : GEOM face associated with theVertex1 - def AddVertexPeriodicity(self, theEdge1, theVertex1, theEdge2, theVertex2): - self.Parameters().AddVertexPeriodicity(theEdge1, theVertex1, theEdge2, theVertex2) - pass - - ## Define periodicity between two groups of faces, given a transformation function. - # This uses the basic BLSURF API for each face, each edge, and each vertex. - # @param theFace1 : GEOM face (or group, compound) to associate with theFace2 - # @param theFace2 : GEOM face (or group, compound) associated with theFace1 - # @param f_transf : python function defining the transformation between an object of theFace1 - # into an object of theFace2 - def AddAdvancedFacesPeriodicity(self, theFace1, theFace2, f_transf): - source_faces = self.geompyD.SubShapeAll(theFace1, self.geompyD.ShapeType["FACE"]) - i = 0 - j = 0 - k = 0 - for source_face in source_faces: - self.geompyD.addToStudyInFather(theFace1, source_face, "source_face_%i"%i) - p_source = self.geompyD.MakeVertexInsideFace(source_face) - p_target = f_transf(p_source) - target_face = self.geompyD.GetFaceNearPoint(theFace2, p_target) - self.geompyD.addToStudyInFather(theFace2, target_face, "target_face_%i"%i) - self.AddFacePeriodicity(source_face, target_face) - i += 1 - - source_edges = self.geompyD.SubShapeAll(source_face, self.geompyD.ShapeType["EDGE"]) - for source_edge in source_edges: - self.geompyD.addToStudyInFather(theFace1, source_edge, "source_edge_%i"%(j)) - p_source = self.geompyD.MakeVertexOnCurve(source_edge, 0.5) - p_target = f_transf(p_source) - target_edge = self.geompyD.GetEdgeNearPoint(theFace2, p_target) - self.geompyD.addToStudyInFather(theFace2, target_edge, "target_edge_%i"%(j)) - self.AddEdgePeriodicity(source_face, source_edge, target_face, target_edge, 1) - j += 1 - - source_vertices = self.geompyD.SubShapeAll(source_edge, self.geompyD.ShapeType["VERTEX"]) - for source_vertex in source_vertices: - self.geompyD.addToStudyInFather(theFace1, source_vertex, "source_vertex_%i"%(k)) - target_vertex_tmp = f_transf(source_vertex) - target_vertex = self.geompyD.GetSame(theFace2, target_vertex_tmp) - self.geompyD.addToStudyInFather(theFace2, target_vertex, "target_vertex_%i"%(k)) - self.AddVertexPeriodicity(source_edge, source_vertex, target_edge, target_vertex) - k += 1 - pass - - ## Define periodicity between two groups of edges, without faces, given a transformation function. - # This uses the basic BLSURF API for each edge and each vertex. - # @param theEdge1 : GEOM edge (or group, compound) to associate with theEdge2 - # @param theEdge2 : GEOM edge (or group, compound) associated with theEdge1 - # @param f_transf : python function defining the transformation between an object of theEdge1 - # into an object of theFace2 - def AddAdvancedEdgesPeriodicity(self, theEdge1, theEdge2, f_transf): - source_edges = self.geompyD.SubShapeAll(theEdge1, self.geompyD.ShapeType["EDGE"]) - j = 0 - k = 0 - for source_edge in source_edges: - self.geompyD.addToStudyInFather(theEdge1, source_edge, "source_edge_%i"%j) - p_source = self.geompyD.MakeVertexOnCurve(source_edge, 0.5) - p_target = f_transf(p_source) - target_edge = self.geompyD.GetEdgeNearPoint(theEdge2, p_target) - self.geompyD.addToStudyInFather(theEdge2, target_edge, "target_edge_%i"%j) - self.AddEdgePeriodicityWithoutFaces(source_edge, target_edge) - - j += 1 - - source_vertices = self.geompyD.SubShapeAll(source_edge, self.geompyD.ShapeType["VERTEX"]) - for source_vertex in source_vertices: - self.geompyD.addToStudyInFather(theEdge1, source_vertex, "source_vertex_%i"%k) - target_vertex_tmp = f_transf(source_vertex) - target_vertex = self.geompyD.GetSame(theEdge2, target_vertex_tmp) - self.geompyD.addToStudyInFather(theEdge2, target_vertex, "target_vertex_%i"%k) - self.AddVertexPeriodicity(source_edge, source_vertex, target_edge, target_vertex) - - k += 1 - pass - #===================== # Obsolete methods #=====================