mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6a4383a6dc | ||
|
59461231ef | ||
|
0b85d5c5e7 | ||
|
7c9e1b2974 | ||
|
73f3d038c8 | ||
|
b72596ba13 | ||
|
d27070fd69 |
@@ -2865,7 +2865,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
|
||||
const Standard_Boolean GlobalEnlargeVfirst,
|
||||
const Standard_Boolean GlobalEnlargeVlast)
|
||||
{
|
||||
const Standard_Real coeff = 4.;
|
||||
const Standard_Real coeff = 2.; //4.;
|
||||
const Standard_Real TolApex = 1.e-5;
|
||||
|
||||
Standard_Boolean SurfaceChange = Standard_False;
|
||||
@@ -3248,7 +3248,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
const Standard_Boolean UpdatePCurve,
|
||||
const Standard_Boolean enlargeU,
|
||||
const Standard_Boolean enlargeVfirst,
|
||||
const Standard_Boolean enlargeVlast)
|
||||
const Standard_Boolean enlargeVlast,
|
||||
const Standard_Boolean UseInfini)
|
||||
{
|
||||
//---------------------------
|
||||
// extension de la geometrie.
|
||||
@@ -3270,8 +3271,20 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
}
|
||||
|
||||
S->Bounds (US1,US2,VS1,VS2);
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
if (UseInfini)
|
||||
{
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Real FaceDU = UF2 - UF1;
|
||||
Standard_Real FaceDV = VF2 - VF1;
|
||||
UU1 = UF1 - FaceDU;
|
||||
UU2 = UF2 + FaceDU;
|
||||
VV1 = VF1 - FaceDV;
|
||||
VV2 = VF2 + FaceDV;
|
||||
}
|
||||
|
||||
if (CanExtentSurface) {
|
||||
SurfaceChange = EnlargeGeometry( S, UU1, UU2, VV1, VV2, isVV1degen, isVV2degen, UF1, UF2, VF1, VF2,
|
||||
@@ -4148,4 +4161,4 @@ void PerformPlanes(const TopoDS_Face& theFace1,
|
||||
Standard_Boolean IsInf(const Standard_Real theVal)
|
||||
{
|
||||
return (theVal > TheInfini*0.9);
|
||||
}
|
||||
}
|
||||
|
@@ -104,7 +104,14 @@ public:
|
||||
//! if <UpdatePCurve> is TRUE, update the pcurves of the
|
||||
//! edges of <F> on the new surface.if the surface has been changed,
|
||||
//! Returns True if The Surface of <NF> has changed.
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F,
|
||||
TopoDS_Face& NF,
|
||||
const Standard_Boolean ChangeGeom,
|
||||
const Standard_Boolean UpDatePCurve = Standard_False,
|
||||
const Standard_Boolean enlargeU = Standard_True,
|
||||
const Standard_Boolean enlargeVfirst = Standard_True,
|
||||
const Standard_Boolean enlargeVlast = Standard_True,
|
||||
const Standard_Boolean UseInfini = Standard_True);
|
||||
|
||||
Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);
|
||||
|
||||
|
1637
src/BRepOffsetAPI/BRepOffsetAPI_PatchFaces.cxx
Normal file
1637
src/BRepOffsetAPI/BRepOffsetAPI_PatchFaces.cxx
Normal file
File diff suppressed because it is too large
Load Diff
131
src/BRepOffsetAPI/BRepOffsetAPI_PatchFaces.hxx
Normal file
131
src/BRepOffsetAPI/BRepOffsetAPI_PatchFaces.hxx
Normal file
@@ -0,0 +1,131 @@
|
||||
// Created on: 2012-08-06
|
||||
// Created by: jgv@ROLEX
|
||||
// Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
#define _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_DataMapOfOrientedShapeShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! Describes functions to replace some faces in a shape
|
||||
//! by patches
|
||||
class BRepOffsetAPI_PatchFaces : public BRepBuilderAPI_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! General constructor.
|
||||
Standard_EXPORT BRepOffsetAPI_PatchFaces(const TopoDS_Shape& aShape);
|
||||
|
||||
//! Adds the patch face for the face in the shape.
|
||||
Standard_EXPORT void AddPatchFace (const TopoDS_Face& theFace, const TopoDS_Face& thePatchFace);
|
||||
|
||||
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
|
||||
TopoDS_Edge& thePrevNewEdge,
|
||||
const TopoDS_Edge& theCurEdge,
|
||||
TopoDS_Edge& theCurNewEdge,
|
||||
TopoDS_Vertex& theCurVertex,
|
||||
const TopoDS_Face& theFace,
|
||||
const TopoDS_Face& theNewFace,
|
||||
TopoDS_Face& theBoundedNewFace);
|
||||
|
||||
Standard_EXPORT void PutVertexToEdge(const TopoDS_Vertex& theVertex,
|
||||
//const TopoDS_Vertex& theProVertex,
|
||||
const TopAbs_Orientation theProVertexOrientation,
|
||||
TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theProEdge,
|
||||
const TopoDS_Face& theFace,
|
||||
const gp_Pnt2d& Pnt2dOnConstEdge,
|
||||
const Standard_Real theParamOnEdge);
|
||||
|
||||
Standard_EXPORT void ProjectVertexOnNewEdge_2d(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theNewEdge,
|
||||
const TopoDS_Face& theNewFace,
|
||||
Standard_Real& theParamOnConst,
|
||||
Standard_Real& theParam,
|
||||
gp_Pnt& thePntOnConst,
|
||||
gp_Pnt& thePnt,
|
||||
gp_Pnt& thePntSol,
|
||||
gp_Pnt2d& thePnt2d,
|
||||
Standard_Real& theTolReached);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMoreThan3Edges(const TopoDS_Vertex& theVertex);
|
||||
|
||||
Standard_EXPORT Standard_Boolean AreSmoothlyConnected(const TopoDS_Edge& theEdge1,
|
||||
const TopoDS_Edge& theEdge2,
|
||||
const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Face& theFace,
|
||||
TopoDS_Edge& theThirdEdge);
|
||||
|
||||
|
||||
TopoDS_Shape myInitialShape;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeShape myFacePatchFace;
|
||||
TopTools_IndexedDataMapOfShapeShape myFaceNewFace;
|
||||
TopTools_DataMapOfShapeShape myNewFaceBoundedFace;
|
||||
TopTools_DataMapOfShapeShape myEdgeNewEdge;
|
||||
//TopTools_DataMapOfOrientedShapeShape myOrientedEdgeNewEdge;
|
||||
TopTools_DataMapOfShapeShape myVertexNewVertex;
|
||||
TopTools_MapOfShape myTangentEdges;
|
||||
TopTools_MapOfShape mySmoothEdges;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myEFmap;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myVEmap;
|
||||
TopTools_DataMapOfShapeListOfShape myVFmap;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepOffsetAPI_PatchFaces_HeaderFile
|
@@ -27,3 +27,5 @@ BRepOffsetAPI_SequenceOfSequenceOfShape.hxx
|
||||
BRepOffsetAPI_Sewing.hxx
|
||||
BRepOffsetAPI_ThruSections.cxx
|
||||
BRepOffsetAPI_ThruSections.hxx
|
||||
BRepOffsetAPI_PatchFaces.cxx
|
||||
BRepOffsetAPI_PatchFaces.hxx
|
||||
|
@@ -62,6 +62,8 @@
|
||||
#include <DBRep_DrawableShape.hxx>
|
||||
#include <BRepTest.hxx>
|
||||
|
||||
#include <BRepOffsetAPI_PatchFaces.hxx>
|
||||
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <ChFi3d_FilletShape.hxx>
|
||||
|
||||
@@ -2287,6 +2289,36 @@ static Standard_Integer ComputeSimpleOffset(Draw_Interpretor& theCommands,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : patchfaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer patchfaces(Draw_Interpretor& /*di*/,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 5) return 1;
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(a[2]);
|
||||
if (aShape.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape aLocalFace = DBRep::Get(a[3], TopAbs_FACE);
|
||||
if (aLocalFace.IsNull()) return 1;
|
||||
TopoDS_Face aFace = TopoDS::Face(aLocalFace);
|
||||
|
||||
TopoDS_Shape aLocalNewFace = DBRep::Get(a[4], TopAbs_FACE);
|
||||
if (aLocalNewFace.IsNull()) return 1;
|
||||
TopoDS_Face aNewFace = TopoDS::Face(aLocalNewFace);
|
||||
|
||||
BRepOffsetAPI_PatchFaces Builder(aShape);
|
||||
Builder.AddPatchFace(aFace, aNewFace);
|
||||
Builder.Build();
|
||||
|
||||
TopoDS_Shape Result = Builder.Shape();
|
||||
DBRep::Set(a[1], Result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FeatureCommands
|
||||
//purpose :
|
||||
@@ -2435,4 +2467,7 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add("offsetshapesimple",
|
||||
"offsetshapesimple result shape offsetvalue [solid] [tolerance=1e-7]",
|
||||
__FILE__, ComputeSimpleOffset);
|
||||
|
||||
theCommands.Add("patchfaces", "patchfaces res shape face newface",
|
||||
__FILE__,patchfaces,g);
|
||||
}
|
||||
|
23
tests/patchfaces/begin
Normal file
23
tests/patchfaces/begin
Normal file
@@ -0,0 +1,23 @@
|
||||
# To prevent loops limit to 10 minutes
|
||||
cpulimit 900
|
||||
if { [array get Draw_Groups "TOPOLOGY Feature commands"] == "" } {
|
||||
pload TOPTEST
|
||||
}
|
||||
if { [array get Draw_Groups "Shape Healing"] == "" } {
|
||||
pload XSDRAW
|
||||
}
|
||||
if { [info exists imagedir] == 0 } {
|
||||
set imagedir .
|
||||
}
|
||||
if { [info exists test_image ] == 0 } {
|
||||
set test_image photo
|
||||
}
|
||||
proc PATCHFACES {i} {
|
||||
uplevel #0 binrestore [locate_data_file shape_3_$i.bin] s
|
||||
uplevel #0 tclean s
|
||||
uplevel #0 removeloc s s
|
||||
uplevel #0 explode s
|
||||
uplevel #0 tcopy s_1 InitShape
|
||||
|
||||
uplevel #0 patchfaces result s_1 s_2 s_3
|
||||
}
|
1
tests/patchfaces/end
Normal file
1
tests/patchfaces/end
Normal file
@@ -0,0 +1 @@
|
||||
puts "TEST COMPLETED"
|
2
tests/patchfaces/grids.list
Normal file
2
tests/patchfaces/grids.list
Normal file
@@ -0,0 +1,2 @@
|
||||
001 replace
|
||||
002 replace_new
|
2
tests/patchfaces/parse.rules
Normal file
2
tests/patchfaces/parse.rules
Normal file
@@ -0,0 +1,2 @@
|
||||
FAILED /\bFaulty\b/ bad shape
|
||||
OK /Relative error of mass computation/ message from vprops
|
1
tests/patchfaces/replace/end
Normal file
1
tests/patchfaces/replace/end
Normal file
@@ -0,0 +1 @@
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
1
tests/patchfaces/replace/test_1
Normal file
1
tests/patchfaces/replace/test_1
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 1
|
1
tests/patchfaces/replace/test_10
Normal file
1
tests/patchfaces/replace/test_10
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 10
|
1
tests/patchfaces/replace/test_11
Normal file
1
tests/patchfaces/replace/test_11
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 11
|
1
tests/patchfaces/replace/test_12
Normal file
1
tests/patchfaces/replace/test_12
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 12
|
1
tests/patchfaces/replace/test_13
Normal file
1
tests/patchfaces/replace/test_13
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 13
|
1
tests/patchfaces/replace/test_14
Normal file
1
tests/patchfaces/replace/test_14
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 14
|
1
tests/patchfaces/replace/test_15
Normal file
1
tests/patchfaces/replace/test_15
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 15
|
1
tests/patchfaces/replace/test_16
Normal file
1
tests/patchfaces/replace/test_16
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 16
|
1
tests/patchfaces/replace/test_17
Normal file
1
tests/patchfaces/replace/test_17
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 17
|
1
tests/patchfaces/replace/test_18
Normal file
1
tests/patchfaces/replace/test_18
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 18
|
1
tests/patchfaces/replace/test_19
Normal file
1
tests/patchfaces/replace/test_19
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 19
|
1
tests/patchfaces/replace/test_2
Normal file
1
tests/patchfaces/replace/test_2
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 2
|
1
tests/patchfaces/replace/test_20
Normal file
1
tests/patchfaces/replace/test_20
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 20
|
1
tests/patchfaces/replace/test_21
Normal file
1
tests/patchfaces/replace/test_21
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 21
|
1
tests/patchfaces/replace/test_22
Normal file
1
tests/patchfaces/replace/test_22
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 22
|
1
tests/patchfaces/replace/test_23
Normal file
1
tests/patchfaces/replace/test_23
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 23
|
1
tests/patchfaces/replace/test_24
Normal file
1
tests/patchfaces/replace/test_24
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 24
|
1
tests/patchfaces/replace/test_25
Normal file
1
tests/patchfaces/replace/test_25
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 25
|
1
tests/patchfaces/replace/test_26
Normal file
1
tests/patchfaces/replace/test_26
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 26
|
1
tests/patchfaces/replace/test_27
Normal file
1
tests/patchfaces/replace/test_27
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 27
|
1
tests/patchfaces/replace/test_28
Normal file
1
tests/patchfaces/replace/test_28
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 28
|
1
tests/patchfaces/replace/test_29
Normal file
1
tests/patchfaces/replace/test_29
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 29
|
1
tests/patchfaces/replace/test_3
Normal file
1
tests/patchfaces/replace/test_3
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 3
|
1
tests/patchfaces/replace/test_30
Normal file
1
tests/patchfaces/replace/test_30
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 30
|
1
tests/patchfaces/replace/test_31
Normal file
1
tests/patchfaces/replace/test_31
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 31
|
1
tests/patchfaces/replace/test_32
Normal file
1
tests/patchfaces/replace/test_32
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 32
|
1
tests/patchfaces/replace/test_33
Normal file
1
tests/patchfaces/replace/test_33
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 33
|
1
tests/patchfaces/replace/test_34
Normal file
1
tests/patchfaces/replace/test_34
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 34
|
1
tests/patchfaces/replace/test_35
Normal file
1
tests/patchfaces/replace/test_35
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 35
|
1
tests/patchfaces/replace/test_4
Normal file
1
tests/patchfaces/replace/test_4
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 4
|
1
tests/patchfaces/replace/test_5
Normal file
1
tests/patchfaces/replace/test_5
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 5
|
1
tests/patchfaces/replace/test_6
Normal file
1
tests/patchfaces/replace/test_6
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 6
|
1
tests/patchfaces/replace/test_7
Normal file
1
tests/patchfaces/replace/test_7
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 7
|
1
tests/patchfaces/replace/test_8
Normal file
1
tests/patchfaces/replace/test_8
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 8
|
1
tests/patchfaces/replace/test_9
Normal file
1
tests/patchfaces/replace/test_9
Normal file
@@ -0,0 +1 @@
|
||||
PATCHFACES 9
|
Reference in New Issue
Block a user