1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,99 +0,0 @@
-- Created on: 1999-10-11
-- Created by: Atelier CAS2000
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-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.
package BRepOffsetAPI
uses
Standard,
StdFail,
gp,
GeomAbs,
Geom,
GeomFill,
Approx,
TopoDS,
TopTools,
BRepAlgo,
BRepBuilderAPI,
BRepSweep,
BRepPrimAPI,
BRepFill,
Law,
Draft,
BRepOffset,
TColStd,
TCollection
is
--
-- Sweeping
--
class MakePipe; --- inherits MakeSweep from BRepPrimAPI
class MakePipeShell; --- inherits MakeSweep from BRepPrimAPI
class MakeDraft; --- inherits MakeShape from BRepBuilderAPI
class DraftAngle; --- inherits MakeShape from BRepBuilderAPI
class FindContigousEdges;
alias Sewing is Sewing from BRepBuilderAPI;
---Purpose: sew the shapes along their common edges
--
-- Evolved and Offseting
--
class MakeOffset; --- inherits MakeShape from BRepBuilderAPI
class MakeOffsetShape; --- inherits MakeShape from BRepBuilderAPI
--Purpose: Offset shape to shells or solids.
class MakeThickSolid; --- inherits MakeOffsetShape from BRepOffsetAPI
class MakeEvolved; --- inherits MakeShape from BRepBuilderAPI
--
-- Construction of Shape through sections.
--
class ThruSections; --- inherits MakeShape from BRepBuilderAPI
class NormalProjection ; --- inherits MakeShape from BRepBuilderAPI
class MiddlePath; --- inherits MakeShape from BRepBuilderAPI
--
-- Plate
--
class MakeFilling; --- inherits MakeShape from BRepBuilderAPI
imported SequenceOfSequenceOfReal;
imported SequenceOfSequenceOfShape;
end;

View File

@@ -1,273 +0,0 @@
-- Created on: 1995-02-22
-- Created by: Jacques GOUSSARD
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-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.
class DraftAngle from BRepOffsetAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Taper-adding transformations on a shape.
-- The resulting shape is constructed by defining one face
-- to be tapered after another one, as well as the
-- geometric properties of their tapered transformation.
-- Each tapered transformation is propagated along the
-- series of faces which are tangential to one another and
-- which contains the face to be tapered.
-- This algorithm is useful in the construction of molds or
-- dies. It facilitates the removal of the article being produced.
-- A DraftAngle object provides a framework for:
-- - initializing the construction algorithm with a given shape,
-- - acquiring the data characterizing the faces to be tapered,
-- - implementing the construction algorithm, and
-- - consulting the results.
-- Warning
-- - This algorithm treats planar, cylindrical and conical faces.
-- - Do not use shapes, which with a draft angle added to
-- a face would modify the topology. This would, for
-- example, involve creation of new vertices, edges or
-- faces, or suppression of existing vertices, edges or faces.
-- - Any face, which is continuous in tangency with the
-- face to be tapered, will also be tapered. These
-- connected faces must also respect the above criteria.
uses
Shape from TopoDS,
Face from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools,
Dir from gp,
Pln from gp,
ErrorStatus from Draft
raises
NotDone from StdFail,
NullObject from Standard,
NoSuchObject from Standard,
ConstructionError from Standard
is
Create
returns DraftAngle from BRepOffsetAPI;
---Purpose: Constructs an empty algorithm to perform
-- taper-adding transformations on faces of a shape.
-- Use the Init function to define the shape to be tapered.
Create(S: Shape from TopoDS)
returns DraftAngle from BRepOffsetAPI;
---Purpose: Initializes an algorithm to perform taper-adding
-- transformations on faces of the shape S.
-- S will be referred to as the initial shape of the algorithm.
Clear(me: in out)
---Purpose: Cancels the results of all taper-adding transformations
-- performed by this algorithm on the initial shape. These
-- results will have been defined by successive calls to the function Add.
is static;
Init(me: in out; S: Shape from TopoDS)
---Purpose: Initializes, or reinitializes this taper-adding algorithm with the shape S.
-- S will be referred to as the initial shape of this algorithm.
is static;
Add(me: in out; F : Face from TopoDS;
Direction : Dir from gp;
Angle : Real from Standard;
NeutralPlane: Pln from gp;
Flag : Boolean from Standard = Standard_True)
---Purpose: Adds the face F, the direction
-- Direction, the angle Angle, the plane NeutralPlane, and the flag
-- Flag to the framework created at construction time, and with this
-- data, defines the taper-adding transformation.
-- F is a face, which belongs to the initial shape of this algorithm or
-- to the shape loaded by the function Init.
-- Only planar, cylindrical or conical faces can be tapered:
-- - If the face F is planar, it is tapered by inclining it
-- through the angle Angle about the line of intersection between the
-- plane NeutralPlane and F.
-- Direction indicates the side of NeutralPlane from which matter is
-- removed if Angle is positive or added if Angle is negative.
-- - If F is cylindrical or conical, it is transformed in the
-- same way on a single face, resulting in a conical face if F
-- is cylindrical, and a conical or cylindrical face if it is already conical.
-- The taper-adding transformation is propagated from the face F along
-- the series of planar, cylindrical or conical faces containing F,
-- which are tangential to one another.
-- Use the function AddDone to check if this taper-adding transformation is successful.
-- Warning
-- Nothing is done if:
-- - the face F does not belong to the initial shape of this algorithm, or
-- - the face F is not planar, cylindrical or conical.
-- Exceptions
-- - Standard_NullObject if the initial shape is not
-- defined, i.e. if this algorithm has not been initialized
-- with the non-empty constructor or the Init function.
-- - Standard_ConstructionError if the previous call to
-- Add has failed. The function AddDone ought to have
-- been used to check for this, and the function Remove
-- to cancel the results of the unsuccessful taper-adding
-- transformation and to retrieve the previous shape.
raises NullObject from Standard,
ConstructionError from Standard
is static;
AddDone(me)
---Purpose: Returns true if the previous taper-adding
-- transformation performed by this algorithm in the last
-- call to Add, was successful.
-- If AddDone returns false:
-- - the function ProblematicShape returns the face
-- on which the error occurred,
-- - the function Remove has to be used to cancel the
-- results of the unsuccessful taper-adding
-- transformation and to retrieve the previous shape.
-- Exceptions
-- Standard_NullObject if the initial shape has not
-- been defined, i.e. if this algorithm has not been
-- initialized with the non-empty constructor or the .Init function.
returns Boolean from Standard
raises NullObject from Standard
is static;
Remove(me: in out; F: Face from TopoDS)
---Purpose: Cancels the taper-adding transformation previously
-- performed by this algorithm on the face F and the
-- series of tangential faces which contain F, and retrieves
-- the shape before the last taper-adding transformation.
-- Warning
-- You will have to use this function if the previous call to
-- Add fails. Use the function AddDone to check it.
-- Exceptions
-- - Standard_NullObject if the initial shape has not
-- been defined, i.e. if this algorithm has not been
-- initialized with the non-empty constructor or the Init function.
-- - Standard_NoSuchObject if F has not been added
-- or has already been removed.
raises NullObject from Standard,
NoSuchObject from Standard
is static;
ProblematicShape(me)
returns Shape from TopoDS
---Purpose: Returns the shape on which an error occurred after an
-- unsuccessful call to Add or when IsDone returns false.
-- Exceptions
-- Standard_NullObject if the initial shape has not been
-- defined, i.e. if this algorithm has not been initialized with
-- the non-empty constructor or the Init function.
---C++: return const&
raises NullObject from Standard
is static;
Status(me)
---Purpose: Returns an error status when an error has occured
-- (Face, Edge or Vertex recomputaion problem).
-- Otherwise returns Draft_NoError. The method may be
-- called if AddDone returns Standard_False, or when
-- IsDone returns Standard_False.
returns ErrorStatus from Draft
raises NullObject from Standard
-- The exception is raised if no shape has been
-- given(constructor or Init method).
is static;
ConnectedFaces(me; F: Face from TopoDS)
returns ListOfShape from TopTools
---Purpose: Returns all the faces which have been added
-- together with the face <F>.
--
---C++: return const&
raises NullObject from Standard,
-- The exception is raised if no shape has been
-- given(constructor or Init method).
NoSuchObject from Standard,
-- The exception is raised if F has not been added.
NotDone from StdFail
-- The exception is raised if AddDone returns False.
is static;
ModifiedFaces(me)
returns ListOfShape from TopTools
---Purpose: Returns all the faces on which a modification has
-- been given.
--
---C++: return const&
raises NullObject from Standard,
-- The exception is raised if no shape has been
-- given(constructor or Init method).
NotDone from StdFail
-- The exception is raised if AddDone returns False.
is static;
Build(me : in out)
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
is redefined;
CorrectWires(me : in out);
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
Modified (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes modified from the shape
-- <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
fields
myModifiedShapes : ListOfShape from TopTools;
end DraftAngle;

View File

@@ -14,48 +14,53 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_DraftAngle.ixx>
#include <Draft_Modification.hxx>
#include <TopoDS.hxx>
#include <Geom_Surface.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepLib.hxx>
#include <BRepFill_DataMapOfShapeSequenceOfReal.hxx>
#include <TopTools_DataMapOfShapeSequenceOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepTools.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TopOpeBRep_EdgesIntersector.hxx>
#include <TopOpeBRep_Point2d.hxx>
#include <Precision.hxx>
#include <BRepFill_DataMapIteratorOfDataMapOfShapeSequenceOfReal.hxx>
#include <BRepOffsetAPI_SequenceOfSequenceOfReal.hxx>
#include <BRepOffsetAPI_SequenceOfSequenceOfShape.hxx>
#include <BRepTools_Substitution.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
#include <BRep_GCurve.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_GCurve.hxx>
#include <TopoDS_Wire.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepFill_DataMapIteratorOfDataMapOfShapeSequenceOfReal.hxx>
#include <BRepFill_DataMapOfShapeSequenceOfReal.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepOffsetAPI_DraftAngle.hxx>
#include <BRepOffsetAPI_SequenceOfSequenceOfReal.hxx>
#include <BRepOffsetAPI_SequenceOfSequenceOfShape.hxx>
#include <BRepTools.hxx>
#include <BRepTools_Substitution.hxx>
#include <Draft_Modification.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#include <StdFail_NotDone.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopOpeBRep_EdgesIntersector.hxx>
#include <TopOpeBRep_Point2d.hxx>
#include <TopTools_DataMapOfShapeSequenceOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
//=======================================================================
//function : BRepOffsetAPI_DraftAngle
//purpose :
//=======================================================================
BRepOffsetAPI_DraftAngle::BRepOffsetAPI_DraftAngle () {}

View File

@@ -0,0 +1,212 @@
// Created on: 1995-02-22
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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_DraftAngle_HeaderFile
#define _BRepOffsetAPI_DraftAngle_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Draft_ErrorStatus.hxx>
class StdFail_NotDone;
class Standard_NullObject;
class Standard_NoSuchObject;
class Standard_ConstructionError;
class TopoDS_Shape;
class TopoDS_Face;
class gp_Dir;
class gp_Pln;
//! Taper-adding transformations on a shape.
//! The resulting shape is constructed by defining one face
//! to be tapered after another one, as well as the
//! geometric properties of their tapered transformation.
//! Each tapered transformation is propagated along the
//! series of faces which are tangential to one another and
//! which contains the face to be tapered.
//! This algorithm is useful in the construction of molds or
//! dies. It facilitates the removal of the article being produced.
//! A DraftAngle object provides a framework for:
//! - initializing the construction algorithm with a given shape,
//! - acquiring the data characterizing the faces to be tapered,
//! - implementing the construction algorithm, and
//! - consulting the results.
//! Warning
//! - This algorithm treats planar, cylindrical and conical faces.
//! - Do not use shapes, which with a draft angle added to
//! a face would modify the topology. This would, for
//! example, involve creation of new vertices, edges or
//! faces, or suppression of existing vertices, edges or faces.
//! - Any face, which is continuous in tangency with the
//! face to be tapered, will also be tapered. These
//! connected faces must also respect the above criteria.
class BRepOffsetAPI_DraftAngle : public BRepBuilderAPI_ModifyShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty algorithm to perform
//! taper-adding transformations on faces of a shape.
//! Use the Init function to define the shape to be tapered.
Standard_EXPORT BRepOffsetAPI_DraftAngle();
//! Initializes an algorithm to perform taper-adding
//! transformations on faces of the shape S.
//! S will be referred to as the initial shape of the algorithm.
Standard_EXPORT BRepOffsetAPI_DraftAngle(const TopoDS_Shape& S);
//! Cancels the results of all taper-adding transformations
//! performed by this algorithm on the initial shape. These
//! results will have been defined by successive calls to the function Add.
Standard_EXPORT void Clear();
//! Initializes, or reinitializes this taper-adding algorithm with the shape S.
//! S will be referred to as the initial shape of this algorithm.
Standard_EXPORT void Init (const TopoDS_Shape& S);
//! Adds the face F, the direction
//! Direction, the angle Angle, the plane NeutralPlane, and the flag
//! Flag to the framework created at construction time, and with this
//! data, defines the taper-adding transformation.
//! F is a face, which belongs to the initial shape of this algorithm or
//! to the shape loaded by the function Init.
//! Only planar, cylindrical or conical faces can be tapered:
//! - If the face F is planar, it is tapered by inclining it
//! through the angle Angle about the line of intersection between the
//! plane NeutralPlane and F.
//! Direction indicates the side of NeutralPlane from which matter is
//! removed if Angle is positive or added if Angle is negative.
//! - If F is cylindrical or conical, it is transformed in the
//! same way on a single face, resulting in a conical face if F
//! is cylindrical, and a conical or cylindrical face if it is already conical.
//! The taper-adding transformation is propagated from the face F along
//! the series of planar, cylindrical or conical faces containing F,
//! which are tangential to one another.
//! Use the function AddDone to check if this taper-adding transformation is successful.
//! Warning
//! Nothing is done if:
//! - the face F does not belong to the initial shape of this algorithm, or
//! - the face F is not planar, cylindrical or conical.
//! Exceptions
//! - Standard_NullObject if the initial shape is not
//! defined, i.e. if this algorithm has not been initialized
//! with the non-empty constructor or the Init function.
//! - Standard_ConstructionError if the previous call to
//! Add has failed. The function AddDone ought to have
//! been used to check for this, and the function Remove
//! to cancel the results of the unsuccessful taper-adding
//! transformation and to retrieve the previous shape.
Standard_EXPORT void Add (const TopoDS_Face& F, const gp_Dir& Direction, const Standard_Real Angle, const gp_Pln& NeutralPlane, const Standard_Boolean Flag = Standard_True);
//! Returns true if the previous taper-adding
//! transformation performed by this algorithm in the last
//! call to Add, was successful.
//! If AddDone returns false:
//! - the function ProblematicShape returns the face
//! on which the error occurred,
//! - the function Remove has to be used to cancel the
//! results of the unsuccessful taper-adding
//! transformation and to retrieve the previous shape.
//! Exceptions
//! Standard_NullObject if the initial shape has not
//! been defined, i.e. if this algorithm has not been
//! initialized with the non-empty constructor or the .Init function.
Standard_EXPORT Standard_Boolean AddDone() const;
//! Cancels the taper-adding transformation previously
//! performed by this algorithm on the face F and the
//! series of tangential faces which contain F, and retrieves
//! the shape before the last taper-adding transformation.
//! Warning
//! You will have to use this function if the previous call to
//! Add fails. Use the function AddDone to check it.
//! Exceptions
//! - Standard_NullObject if the initial shape has not
//! been defined, i.e. if this algorithm has not been
//! initialized with the non-empty constructor or the Init function.
//! - Standard_NoSuchObject if F has not been added
//! or has already been removed.
Standard_EXPORT void Remove (const TopoDS_Face& F);
//! Returns the shape on which an error occurred after an
//! unsuccessful call to Add or when IsDone returns false.
//! Exceptions
//! Standard_NullObject if the initial shape has not been
//! defined, i.e. if this algorithm has not been initialized with
//! the non-empty constructor or the Init function.
Standard_EXPORT const TopoDS_Shape& ProblematicShape() const;
//! Returns an error status when an error has occured
//! (Face, Edge or Vertex recomputaion problem).
//! Otherwise returns Draft_NoError. The method may be
//! called if AddDone returns Standard_False, or when
//! IsDone returns Standard_False.
Standard_EXPORT Draft_ErrorStatus Status() const;
//! Returns all the faces which have been added
//! together with the face <F>.
Standard_EXPORT const TopTools_ListOfShape& ConnectedFaces (const TopoDS_Face& F) const;
//! Returns all the faces on which a modification has
//! been given.
Standard_EXPORT const TopTools_ListOfShape& ModifiedFaces() const;
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
Standard_EXPORT void CorrectWires();
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
TopTools_ListOfShape myModifiedShapes;
};
#endif // _BRepOffsetAPI_DraftAngle_HeaderFile

View File

@@ -1,170 +0,0 @@
-- Created on: 1995-05-02
-- Created by: Jing Cheng MEI
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-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.
class FindContigousEdges from BRepOffsetAPI
---Purpose: Provides methods to identify contigous boundaries
-- for continuity control (C0, C1, ...)
--
-- Use this function as following:
-- - create an object
-- - default tolerance 1.E-06
-- - with analysis of degenerated faces on
-- - define if necessary a new tolerance
-- - set if necessary analysis of degenerated shapes off
-- - add shapes to be controlled -> Add
-- - compute -> Perfom
-- - output couples of connected edges for control
-- - output the problems if any
uses
Edge from TopoDS,
Shape from TopoDS,
ListOfShape from TopTools,
Sewing from BRepBuilderAPI
raises
OutOfRange from Standard,
NoSuchObject from Standard
is
Create(tolerance: Real = 1.0e-06; -- tolerance of connexity
option: Boolean = Standard_True) -- option for analysis of degenerated shapes
---Purpose: Initializes an algorithm for identifying contiguous edges
-- on shapes with tolerance as the tolerance of contiguity
-- (defaulted to 1.0e-6). This tolerance value is used to
-- determine whether two edges or sections of edges are coincident.
-- Use the function Add to define the shapes to be checked.
-- Set option to false. This argument (defaulted to true) will
-- serve in subsequent software releases for performing an
-- analysis of degenerated shapes.
returns FindContigousEdges from BRepOffsetAPI;
Init(me: in out; tolerance: Real; option: Boolean);
---Purpose: Initializes this algorithm for identifying contiguous edges
-- on shapes using the tolerance of contiguity tolerance.
-- This tolerance value is used to determine whether two
-- edges or sections of edges are coincident.
-- Use the function Add to define the shapes to be checked.
-- Sets <option> to false.
Add(me: in out; shape: Shape from TopoDS);
---Purpose: Adds the shape shape to the list of shapes to be
-- checked by this algorithm.
-- Once all the shapes to be checked have been added,
-- use the function Perform to find the contiguous edges
-- and the function ContigousEdge to return these edges.
Perform(me: in out);
---Purpose: Finds coincident parts of edges of two or more shapes
-- added to this algorithm and breaks down these edges
-- into contiguous and non-contiguous sections on copies
-- of the initial shapes.
-- The function ContigousEdge returns contiguous
-- edges. The function Modified can be used to return
-- modified copies of the initial shapes where one or more
-- edges were broken down into contiguous and non-contiguous sections.
-- Warning
-- This function must be used once all the shapes to be
-- checked have been added. It is not possible to add
-- further shapes subsequently and then to repeat the call to Perform.
NbEdges(me) returns Integer;
---Purpose: Gives the number of edges (free edges + contigous
-- edges + multiple edge)
NbContigousEdges(me) returns Integer;
---Purpose: Returns the number of contiguous edges found by the
-- function Perform on the shapes added to this algorithm.
ContigousEdge(me; index: Integer) returns Edge from TopoDS
---Purpose: Returns the contiguous edge of index index found by
-- the function Perform on the shapes added to this algorithm.
-- Exceptions
-- Standard_OutOfRange if:
-- - index is less than 1, or
-- - index is greater than the number of contiguous
-- edges found by the function Perform on the shapes added to this algorithm.
---C++: return const &
raises
OutOfRange from Standard;
ContigousEdgeCouple(me; index: Integer) returns ListOfShape from TopTools
---Purpose: Returns a list of edges coincident with the contiguous
-- edge of index index found by the function Perform.
-- There are as many edges in the list as there are faces
-- adjacent to this contiguous edge.
-- Exceptions
-- Standard_OutOfRange if:
-- - index is less than 1, or
-- - index is greater than the number of contiguous edges
-- found by the function Perform on the shapes added to this algorithm.
---C++: return const &
raises
OutOfRange from Standard;
SectionToBoundary(me; section: Edge from TopoDS) returns Edge from TopoDS
---Purpose: Returns the edge on the initial shape, of which the
-- modified copy contains the edge section.
-- section is coincident with a contiguous edge found by
-- the function Perform. Use the function
-- ContigousEdgeCouple to obtain a valid section.
-- This information is useful for verification purposes, since
-- it provides a means of determining the surface to which
-- the contiguous edge belongs.
-- Exceptions
-- Standard_NoSuchObject if section is not coincident
-- with a contiguous edge. Use the function
-- ContigousEdgeCouple to obtain a valid section.
---C++: return const &
raises
NoSuchObject from Standard;
NbDegeneratedShapes(me) returns Integer;
---Purpose: Gives the number of degenerated shapes
DegeneratedShape(me; index: Integer) returns Shape from TopoDS
---Purpose: Gives a degenerated shape
---C++: return const &
raises
OutOfRange from Standard;
-- raised if index < 1 or > NbDegeneratedShapes
IsDegenerated(me; shape: Shape from TopoDS) returns Boolean;
---Purpose: Indicates if a input shape is degenerated
IsModified(me; shape: Shape from TopoDS) returns Boolean;
---Purpose: Returns true if the copy of the initial shape shape was
-- modified by the function Perform (i.e. if one or more of
-- its edges was broken down into contiguous and non-contiguous sections).
-- Warning
-- Returns false if shape is not one of the initial shapes
-- added to this algorithm.
Modified(me; shape: Shape from TopoDS) returns Shape from TopoDS
---Purpose: Gives a modifieded shape
-- Raises NoSuchObject if shape has not been modified
---C++: return const &
raises
NoSuchObject from Standard;
Dump(me);
---Purpose: Dump properties of resulting shape.
fields
mySewing : Sewing from BRepBuilderAPI;
end FindContigousEdges;

View File

@@ -14,14 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_FindContigousEdges.ixx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepOffsetAPI_FindContigousEdges.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_OutOfRange.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BRepOffsetAPI_FindContigousEdges::BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance,
const Standard_Boolean option)
{

View File

@@ -0,0 +1,184 @@
// Created on: 1995-05-02
// Created by: Jing Cheng MEI
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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_FindContigousEdges_HeaderFile
#define _BRepOffsetAPI_FindContigousEdges_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TopTools_ListOfShape.hxx>
class BRepBuilderAPI_Sewing;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class TopoDS_Shape;
class TopoDS_Edge;
//! Provides methods to identify contigous boundaries
//! for continuity control (C0, C1, ...)
//!
//! Use this function as following:
//! - create an object
//! - default tolerance 1.E-06
//! - with analysis of degenerated faces on
//! - define if necessary a new tolerance
//! - set if necessary analysis of degenerated shapes off
//! - add shapes to be controlled -> Add
//! - compute -> Perfom
//! - output couples of connected edges for control
//! - output the problems if any
class BRepOffsetAPI_FindContigousEdges
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes an algorithm for identifying contiguous edges
//! on shapes with tolerance as the tolerance of contiguity
//! (defaulted to 1.0e-6). This tolerance value is used to
//! determine whether two edges or sections of edges are coincident.
//! Use the function Add to define the shapes to be checked.
//! Set option to false. This argument (defaulted to true) will
//! serve in subsequent software releases for performing an
//! analysis of degenerated shapes.
Standard_EXPORT BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance = 1.0e-06, const Standard_Boolean option = Standard_True);
//! Initializes this algorithm for identifying contiguous edges
//! on shapes using the tolerance of contiguity tolerance.
//! This tolerance value is used to determine whether two
//! edges or sections of edges are coincident.
//! Use the function Add to define the shapes to be checked.
//! Sets <option> to false.
Standard_EXPORT void Init (const Standard_Real tolerance, const Standard_Boolean option);
//! Adds the shape shape to the list of shapes to be
//! checked by this algorithm.
//! Once all the shapes to be checked have been added,
//! use the function Perform to find the contiguous edges
//! and the function ContigousEdge to return these edges.
Standard_EXPORT void Add (const TopoDS_Shape& shape);
//! Finds coincident parts of edges of two or more shapes
//! added to this algorithm and breaks down these edges
//! into contiguous and non-contiguous sections on copies
//! of the initial shapes.
//! The function ContigousEdge returns contiguous
//! edges. The function Modified can be used to return
//! modified copies of the initial shapes where one or more
//! edges were broken down into contiguous and non-contiguous sections.
//! Warning
//! This function must be used once all the shapes to be
//! checked have been added. It is not possible to add
//! further shapes subsequently and then to repeat the call to Perform.
Standard_EXPORT void Perform();
//! Gives the number of edges (free edges + contigous
//! edges + multiple edge)
Standard_EXPORT Standard_Integer NbEdges() const;
//! Returns the number of contiguous edges found by the
//! function Perform on the shapes added to this algorithm.
Standard_EXPORT Standard_Integer NbContigousEdges() const;
//! Returns the contiguous edge of index index found by
//! the function Perform on the shapes added to this algorithm.
//! Exceptions
//! Standard_OutOfRange if:
//! - index is less than 1, or
//! - index is greater than the number of contiguous
//! edges found by the function Perform on the shapes added to this algorithm.
Standard_EXPORT const TopoDS_Edge& ContigousEdge (const Standard_Integer index) const;
//! Returns a list of edges coincident with the contiguous
//! edge of index index found by the function Perform.
//! There are as many edges in the list as there are faces
//! adjacent to this contiguous edge.
//! Exceptions
//! Standard_OutOfRange if:
//! - index is less than 1, or
//! - index is greater than the number of contiguous edges
//! found by the function Perform on the shapes added to this algorithm.
Standard_EXPORT const TopTools_ListOfShape& ContigousEdgeCouple (const Standard_Integer index) const;
//! Returns the edge on the initial shape, of which the
//! modified copy contains the edge section.
//! section is coincident with a contiguous edge found by
//! the function Perform. Use the function
//! ContigousEdgeCouple to obtain a valid section.
//! This information is useful for verification purposes, since
//! it provides a means of determining the surface to which
//! the contiguous edge belongs.
//! Exceptions
//! Standard_NoSuchObject if section is not coincident
//! with a contiguous edge. Use the function
//! ContigousEdgeCouple to obtain a valid section.
Standard_EXPORT const TopoDS_Edge& SectionToBoundary (const TopoDS_Edge& section) const;
//! Gives the number of degenerated shapes
Standard_EXPORT Standard_Integer NbDegeneratedShapes() const;
//! Gives a degenerated shape
Standard_EXPORT const TopoDS_Shape& DegeneratedShape (const Standard_Integer index) const;
//! Indicates if a input shape is degenerated
Standard_EXPORT Standard_Boolean IsDegenerated (const TopoDS_Shape& shape) const;
//! Returns true if the copy of the initial shape shape was
//! modified by the function Perform (i.e. if one or more of
//! its edges was broken down into contiguous and non-contiguous sections).
//! Warning
//! Returns false if shape is not one of the initial shapes
//! added to this algorithm.
Standard_EXPORT Standard_Boolean IsModified (const TopoDS_Shape& shape) const;
//! Gives a modifieded shape
//! Raises NoSuchObject if shape has not been modified
Standard_EXPORT const TopoDS_Shape& Modified (const TopoDS_Shape& shape) const;
//! Dump properties of resulting shape.
Standard_EXPORT void Dump() const;
protected:
private:
Handle(BRepBuilderAPI_Sewing) mySewing;
};
#endif // _BRepOffsetAPI_FindContigousEdges_HeaderFile

View File

@@ -1,128 +0,0 @@
-- Created on: 1999-01-13
-- Created by: Philippe MANGIN
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakeDraft from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Build a draft surface along a wire
-- The wire can be defined by
-- - a wire
-- - a face (the forward wire)
-- - a shell (the free bounds)
-- The Draft geometry is defined by
-- A wire, a direction and angle between the line section
-- and the dircection
-- The Draft can be limited by
-- a length of the segment to sweep
-- a surface
-- a shape
uses
Shape from TopoDS,
Shell from TopoDS,
Dir from gp,
ListOfShape from TopTools,
TransitionMode from BRepBuilderAPI,
Draft from BRepFill,
Surface from Geom
raises
NotDone,
NoSuchObject
is
Create(Shape : Shape from TopoDS;
Dir : Dir from gp;
Angle : Real)
---Purpose: Constructs the draft surface object defined by the shape
-- Shape, the direction Dir, and the angle Angle.
-- Shape must be a TopoDS_Wire, Topo_DS_Face or
-- TopoDS_Shell with free boundaries.
-- Exceptions
-- Standard_NotDone if Shape is not a TopoDS_Wire,
-- Topo_DS_Face or TopoDS_Shell with free boundaries.
returns MakeDraft from BRepOffsetAPI;
SetOptions(me : in out;
Style : TransitionMode from BRepBuilderAPI = BRepBuilderAPI_RightCorner;
AngleMin : Real = 0.01;
AngleMax : Real = 3.0)
---Purpose: Sets the options of this draft tool.
-- If a transition has to be performed, it can be defined by
-- the mode Style as RightCorner or RoundCorner,
-- RightCorner being a corner defined by a sharp angle,
-- and RoundCorner being a rounded corner.
-- AngleMin is an angular tolerance used to detect
-- whether a transition has to be performed or not.
-- AngleMax sets the maximum value within which a
-- RightCorner transition can be performed.
-- AngleMin and AngleMax are expressed in radians.
is static;
SetDraft(me: in out; IsInternal : Boolean = Standard_False)
---Purpose: Sets the direction of the draft for this object.
-- If IsInternal is true, the draft is internal to the argument
-- Shape used in the constructor.
is static;
Perform(me : in out;
LengthMax : Real)
---Purpose: Performs the draft using the length LengthMax as the
-- maximum length for the corner edge between two draft faces.
is static;
Perform(me : in out;
Surface : Surface from Geom;
KeepInsideSurface : Boolean = Standard_True)
---Purpose: Performs the draft up to the surface Surface.
-- If KeepInsideSurface is true, the part of Surface inside
-- the draft is kept in the result.
is static;
Perform(me : in out;
StopShape : Shape from TopoDS;
KeepOutSide : Boolean = Standard_True)
---Purpose: Performs the draft up to the shape StopShape.
-- If KeepOutSide is true, the part of StopShape which is
-- outside the Draft is kept in the result.
is static;
Shell(me)
---Purpose: Returns the shell resulting from performance of the
-- draft along the wire.
returns Shell from TopoDS
raises NotDone;
-- Error(me) returns MakeDraftError from BRepBuilderAPI
-- ---Level: Public
-- is static;
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined;
fields
myDraft : Draft from BRepFill;
end MakeDraft;

View File

@@ -11,8 +11,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakeDraft.ixx>
#include <BRepOffsetAPI_MakeDraft.hxx>
#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
#include <Standard_NoSuchObject.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
BRepOffsetAPI_MakeDraft::BRepOffsetAPI_MakeDraft(const TopoDS_Shape& Shape,
const gp_Dir& Dir,

View File

@@ -0,0 +1,118 @@
// Created on: 1999-01-13
// Created by: Philippe MANGIN
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-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_MakeDraft_HeaderFile
#define _BRepOffsetAPI_MakeDraft_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_Draft.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <BRepBuilderAPI_TransitionMode.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
class StdFail_NotDone;
class Standard_NoSuchObject;
class TopoDS_Shape;
class gp_Dir;
class Geom_Surface;
class TopoDS_Shell;
//! Build a draft surface along a wire
class BRepOffsetAPI_MakeDraft : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs the draft surface object defined by the shape
//! Shape, the direction Dir, and the angle Angle.
//! Shape must be a TopoDS_Wire, Topo_DS_Face or
//! TopoDS_Shell with free boundaries.
//! Exceptions
//! Standard_NotDone if Shape is not a TopoDS_Wire,
//! Topo_DS_Face or TopoDS_Shell with free boundaries.
Standard_EXPORT BRepOffsetAPI_MakeDraft(const TopoDS_Shape& Shape, const gp_Dir& Dir, const Standard_Real Angle);
//! Sets the options of this draft tool.
//! If a transition has to be performed, it can be defined by
//! the mode Style as RightCorner or RoundCorner,
//! RightCorner being a corner defined by a sharp angle,
//! and RoundCorner being a rounded corner.
//! AngleMin is an angular tolerance used to detect
//! whether a transition has to be performed or not.
//! AngleMax sets the maximum value within which a
//! RightCorner transition can be performed.
//! AngleMin and AngleMax are expressed in radians.
Standard_EXPORT void SetOptions (const BRepBuilderAPI_TransitionMode Style = BRepBuilderAPI_RightCorner, const Standard_Real AngleMin = 0.01, const Standard_Real AngleMax = 3.0);
//! Sets the direction of the draft for this object.
//! If IsInternal is true, the draft is internal to the argument
//! Shape used in the constructor.
Standard_EXPORT void SetDraft (const Standard_Boolean IsInternal = Standard_False);
//! Performs the draft using the length LengthMax as the
//! maximum length for the corner edge between two draft faces.
Standard_EXPORT void Perform (const Standard_Real LengthMax);
//! Performs the draft up to the surface Surface.
//! If KeepInsideSurface is true, the part of Surface inside
//! the draft is kept in the result.
Standard_EXPORT void Perform (const Handle(Geom_Surface)& Surface, const Standard_Boolean KeepInsideSurface = Standard_True);
//! Performs the draft up to the shape StopShape.
//! If KeepOutSide is true, the part of StopShape which is
//! outside the Draft is kept in the result.
Standard_EXPORT void Perform (const TopoDS_Shape& StopShape, const Standard_Boolean KeepOutSide = Standard_True);
//! Returns the shell resulting from performance of the
//! draft along the wire.
Standard_EXPORT TopoDS_Shell Shell() const;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
BRepFill_Draft myDraft;
};
#endif // _BRepOffsetAPI_MakeDraft_HeaderFile

View File

@@ -1,130 +0,0 @@
-- Created on: 1995-09-18
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakeEvolved from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build evolved shapes.
-- An evolved shape is built from a planar spine (face or
-- wire) and a profile (wire). The evolved shape is the
-- unlooped sweep (pipe) of the profile along the spine.
-- Self-intersections are removed.
-- A MakeEvolved object provides a framework for:
-- - defining the construction of an evolved shape,
-- - implementing the construction algorithm, and
-- - consulting the result.
-- Computes an Evolved by
-- 1 - sweeping a profil along a spine.
-- 2 - removing the self-intersections.
--
-- The profile is defined in a Referential R. The position of
-- the profile at the current point of the spine is given by
-- confusing R and the local referential given by ( D0, D1
-- and the normal of the Spine)
--
-- If the Boolean <AxeProf> is true, R is O,X,Y,Z
-- else R is defined as the local refential at the nearest
-- point of the profil to the spine.
--
-- if <Solid> is TRUE the Shape result is completed to be a
-- solid or a compound of solids.
uses
Evolved from BRepFill,
ListOfShape from TopTools,
Shape from TopoDS,
Face from TopoDS,
Wire from TopoDS,
JoinType from GeomAbs
is
Create returns MakeEvolved from BRepOffsetAPI;
Create( Spine : Wire from TopoDS;
Profil : Wire from TopoDS;
Join : JoinType from GeomAbs = GeomAbs_Arc;
AxeProf : Boolean from Standard = Standard_True;
Solid : Boolean from Standard = Standard_False;
ProfOnSpine: Boolean from Standard = Standard_False;
Tol : Real from Standard = 0.0000001)
---Purpose:
---Level: Public
returns MakeEvolved from BRepOffsetAPI;
Create( Spine : Face from TopoDS;
Profil : Wire from TopoDS;
Join : JoinType from GeomAbs = GeomAbs_Arc;
AxeProf : Boolean from Standard = Standard_True;
Solid : Boolean from Standard = Standard_False;
ProfOnSpine: Boolean from Standard = Standard_False;
Tol : Real from Standard = 0.0000001)
---Purpose: These constructors construct an evolved shape by sweeping the profile
-- Profile along the spine Spine.
-- The profile is defined in a coordinate system R.
-- The coordinate system is determined by AxeProf:
-- - if AxeProf is true, R is the global coordinate system,
-- - if AxeProf is false, R is computed so that:
-- - its origin is given by the point on the spine which is
-- closest to the profile,
-- - its "X Axis" is given by the tangent to the spine at this point, and
-- - its "Z Axis" is the normal to the plane which contains the spine.
-- The position of the profile at the current point of the
-- spine is given by making R coincident with the local
-- coordinate system given by the current point, the
-- tangent vector and the normal to the spine.
-- Join defines the type of pipe generated by the salient
-- vertices of the spine. The default type is GeomAbs_Arc
-- where the vertices generate revolved pipes about the
-- axis passing along the vertex and the normal to the
-- plane of the spine. At present, this is the only
-- construction type implemented.
returns MakeEvolved from BRepOffsetAPI;
Evolved(me) returns Evolved from BRepFill
---C++: return const &
---Level: Advanced
is static;
Build(me : in out)
is redefined;
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
GeneratedShapes (me ;
SpineShape : Shape from TopoDS;
ProfShape : Shape from TopoDS)
---Purpose: Returns the shapes created from a subshape
-- <SpineShape> of the spine and a subshape
-- <ProfShape> on the profile.
---C++ : return const &
returns ListOfShape from TopTools
is static;
Top (me) returns Shape from TopoDS
---Purpose: Return the face Top if <Solid> is True in the constructor.
---C++ : return const &
is static;
Bottom (me) returns Shape from TopoDS
---Purpose: Return the face Bottom if <Solid> is True in the constructor.
---C++ : return const &
is static;
fields
myEvolved : Evolved from BRepFill;
end MakeEvolved;

View File

@@ -14,16 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakeEvolved.ixx>
#include <gp_Ax3.hxx>
#include <BRepFill.hxx>
#include <BRepFill_Evolved.hxx>
#include <BRepOffsetAPI_MakeEvolved.hxx>
#include <gp_Ax3.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
//=======================================================================
//function : BRepOffsetAPI_MakeEvolved
//purpose :
//=======================================================================
BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved()
{
}

View File

@@ -0,0 +1,133 @@
// Created on: 1995-09-18
// Created by: Bruno DUMORTIER
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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_MakeEvolved_HeaderFile
#define _BRepOffsetAPI_MakeEvolved_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_Evolved.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <GeomAbs_JoinType.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <TopTools_ListOfShape.hxx>
class TopoDS_Wire;
class TopoDS_Face;
class BRepFill_Evolved;
class TopoDS_Shape;
//! Describes functions to build evolved shapes.
//! An evolved shape is built from a planar spine (face or
//! wire) and a profile (wire). The evolved shape is the
//! unlooped sweep (pipe) of the profile along the spine.
//! Self-intersections are removed.
//! A MakeEvolved object provides a framework for:
//! - defining the construction of an evolved shape,
//! - implementing the construction algorithm, and
//! - consulting the result.
//! Computes an Evolved by
//! 1 - sweeping a profil along a spine.
//! 2 - removing the self-intersections.
//!
//! The profile is defined in a Referential R. The position of
//! the profile at the current point of the spine is given by
//! confusing R and the local referential given by ( D0, D1
//! and the normal of the Spine)
//!
//! If the Boolean <AxeProf> is true, R is O,X,Y,Z
//! else R is defined as the local refential at the nearest
//! point of the profil to the spine.
//!
//! if <Solid> is TRUE the Shape result is completed to be a
//! solid or a compound of solids.
class BRepOffsetAPI_MakeEvolved : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepOffsetAPI_MakeEvolved();
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Wire& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean AxeProf = Standard_True, const Standard_Boolean Solid = Standard_False, const Standard_Boolean ProfOnSpine = Standard_False, const Standard_Real Tol = 0.0000001);
//! These constructors construct an evolved shape by sweeping the profile
//! Profile along the spine Spine.
//! The profile is defined in a coordinate system R.
//! The coordinate system is determined by AxeProf:
//! - if AxeProf is true, R is the global coordinate system,
//! - if AxeProf is false, R is computed so that:
//! - its origin is given by the point on the spine which is
//! closest to the profile,
//! - its "X Axis" is given by the tangent to the spine at this point, and
//! - its "Z Axis" is the normal to the plane which contains the spine.
//! The position of the profile at the current point of the
//! spine is given by making R coincident with the local
//! coordinate system given by the current point, the
//! tangent vector and the normal to the spine.
//! Join defines the type of pipe generated by the salient
//! vertices of the spine. The default type is GeomAbs_Arc
//! where the vertices generate revolved pipes about the
//! axis passing along the vertex and the normal to the
//! plane of the spine. At present, this is the only
//! construction type implemented.
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Face& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean AxeProf = Standard_True, const Standard_Boolean Solid = Standard_False, const Standard_Boolean ProfOnSpine = Standard_False, const Standard_Real Tol = 0.0000001);
Standard_EXPORT const BRepFill_Evolved& Evolved() const;
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns the shapes created from a subshape
//! <SpineShape> of the spine and a subshape
//! <ProfShape> on the profile.
Standard_EXPORT const TopTools_ListOfShape& GeneratedShapes (const TopoDS_Shape& SpineShape, const TopoDS_Shape& ProfShape) const;
//! Return the face Top if <Solid> is True in the constructor.
Standard_EXPORT const TopoDS_Shape& Top() const;
//! Return the face Bottom if <Solid> is True in the constructor.
Standard_EXPORT const TopoDS_Shape& Bottom() const;
protected:
private:
BRepFill_Evolved myEvolved;
};
#endif // _BRepOffsetAPI_MakeEvolved_HeaderFile

View File

@@ -1,256 +0,0 @@
-- Created on: 1998-08-26
-- Created by: Julia GERASIMOVA
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakeFilling from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: N-Side Filling
-- This algorithm avoids to build a face from:
-- * a set of edges defining the bounds of the face and some
-- constraints the surface of the face has to satisfy
-- * a set of edges and points defining some constraints
-- the support surface has to satisfy
-- * an initial surface to deform for satisfying the constraints
-- * a set of parameters to control the constraints.
--
-- The support surface of the face is computed by deformation
-- of the initial surface in order to satisfy the given constraints.
-- The set of bounding edges defines the wire of the face.
--
-- If no initial surface is given, the algorithm computes it
-- automatically.
-- If the set of edges is not connected (Free constraint)
-- missing edges are automatically computed.
--
-- Limitations:
-- * If some constraints are not compatible
-- The algorithm does not take them into account.
-- So the constraints will not be satisfyed in an area containing
-- the incompatibilitries.
-- * The constraints defining the bound of the face have to be
-- entered in order to have a continuous wire.
--
-- Other Applications:
-- * Deformation of a face to satisfy internal constraints
-- * Deformation of a face to improve Gi continuity with
-- connected faces
---Level: Advanced
uses
Shape from TopoDS,
Edge from TopoDS,
Face from TopoDS,
Pnt from gp,
Shape from GeomAbs,
ListOfShape from TopTools,
Filling from BRepFill
raises
NotDone,
OutOfRange,
ConstructionError
is
Create( Degree : Integer from Standard = 3;
NbPtsOnCur : Integer from Standard = 15;
NbIter : Integer from Standard = 2;
Anisotropie : Boolean from Standard = Standard_False;
Tol2d : Real from Standard = 0.00001;
Tol3d : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1;
MaxDeg : Integer from Standard = 8;
MaxSegments : Integer from Standard = 9 )
---Purpose: Constructs a wire filling object defined by
-- - the energy minimizing criterion Degree
-- - the number of points on the curve NbPntsOnCur
-- - the number of iterations NbIter
-- - the Boolean Anisotropie
-- - the 2D tolerance Tol2d
-- - the 3D tolerance Tol3d
-- - the angular tolerance TolAng
-- - the tolerance for curvature TolCur
-- - the highest polynomial degree MaxDeg
-- - the greatest number of segments MaxSeg.
-- If the Boolean Anistropie is true, the algorithm's
-- performance is better in cases where the ratio of the
-- length U and the length V indicate a great difference
-- between the two. In other words, when the surface is, for
-- example, extremely long.
returns MakeFilling from BRepOffsetAPI;
SetConstrParam( me : in out; Tol2d : Real from Standard = 0.00001;
Tol3d : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1 );
---Purpose: Sets the values of Tolerances used to control the constraint.
-- Tol2d:
-- Tol3d: it is the maximum distance allowed between the support surface
-- and the constraints
-- TolAng: it is the maximum angle allowed between the normal of the surface
-- and the constraints
-- TolCurv: it is the maximum difference of curvature allowed between
-- the surface and the constraint
SetResolParam( me : in out; Degree : Integer from Standard = 3;
NbPtsOnCur : Integer from Standard = 15;
NbIter : Integer from Standard = 2;
Anisotropie : Boolean from Standard = Standard_False );
---Purpose: Sets the parameters used for resolution.
-- The default values of these parameters have been chosen for a good
-- ratio quality/performance.
-- Degree: it is the order of energy criterion to minimize for computing
-- the deformation of the surface.
-- The default value is 3
-- The recommanded value is i+2 where i is the maximum order of the
-- constraints.
-- NbPtsOnCur: it is the average number of points for discretisation
-- of the edges.
-- NbIter: it is the maximum number of iterations of the process.
-- For each iteration the number of discretisation points is
-- increased.
-- Anisotropie:
SetApproxParam( me : in out; MaxDeg : Integer from Standard = 8;
MaxSegments : Integer from Standard = 9 );
---Purpose: Sets the parameters used to approximate the filling
-- surface. These include:
-- - MaxDeg - the highest degree which the polynomial
-- defining the filling surface can have
-- - MaxSegments - the greatest number of segments
-- which the filling surface can have.
LoadInitSurface( me : in out; Surf : Face from TopoDS );
---Purpose: Loads the initial surface Surf to
-- begin the construction of the surface.
-- This optional function is useful if the surface resulting from
-- construction for the algorithm is likely to be complex.
-- The support surface of the face under construction is computed by a
-- deformation of Surf which satisfies the given constraints.
-- The set of bounding edges defines the wire of the face.
-- If no initial surface is given, the algorithm computes it
-- automatically. If the set of edges is not connected (Free constraint),
-- missing edges are automatically computed.
-- Important: the initial surface must have orthogonal local coordinates,
-- i.e. partial derivatives dS/du and dS/dv must be orthogonal
-- at each point of surface.
-- If this condition breaks, distortions of resulting surface
-- are possible.
Add( me : in out; Constr : Edge from TopoDS;
Order : Shape from GeomAbs;
IsBound : Boolean from Standard = Standard_True )
returns Integer from Standard
---Purpose: Adds a new constraint which also defines an edge of the wire
-- of the face
-- Order: Order of the constraint:
-- GeomAbs_C0 : the surface has to pass by 3D representation
-- of the edge
-- GeomAbs_G1 : the surface has to pass by 3D representation
-- of the edge and to respect tangency with the first
-- face of the edge
-- GeomAbs_G2 : the surface has to pass by 3D representation
-- of the edge and to respect tangency and curvature
-- with the first face of the edge.
-- Raises ConstructionError if the edge has no representation on a face and Order is
-- GeomAbs_G1 or GeomAbs_G2.
raises ConstructionError from Standard;
Add( me : in out; Constr : Edge from TopoDS;
Support : Face from TopoDS;
Order : Shape from GeomAbs;
IsBound : Boolean from Standard = Standard_True )
returns Integer from Standard
---Purpose: Adds a new constraint which also defines an edge of the wire
-- of the face
-- Order: Order of the constraint:
-- GeomAbs_C0 : the surface has to pass by 3D representation
-- of the edge
-- GeomAbs_G1 : the surface has to pass by 3D representation
-- of the edge and to respect tangency with the
-- given face
-- GeomAbs_G2 : the surface has to pass by 3D representation
-- of the edge and to respect tangency and curvature
-- with the given face.
-- Raises ConstructionError if the edge has no 2d representation on the given face
raises ConstructionError from Standard;
Add( me : in out; Support : Face from TopoDS;
Order : Shape from GeomAbs )
returns Integer from Standard;
---Purpose: Adds a free constraint on a face. The corresponding edge has to
-- be automatically recomputed. It is always a bound.
Add( me : in out; Point : Pnt from gp )
returns Integer from Standard;
---Purpose: Adds a punctual constraint.
Add( me : in out; U, V : Real from Standard;
Support : Face from TopoDS;
Order : Shape from GeomAbs )
returns Integer from Standard;
---Purpose: Adds a punctual constraint.
Build( me : in out )
---Purpose: Builds the resulting faces
is redefined;
IsDone(me) returns Boolean from Standard
is redefined;
--- Purpose: Tests whether computation of the filling plate has been completed.
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined;
G0Error(me) returns Real from Standard;
--- Purpose: Returns the maximum distance between the result and
-- the constraints. This is set at construction time.
G1Error(me) returns Real from Standard;
---Purpose: Returns the maximum angle between the result and the
-- constraints. This is set at construction time.
G2Error(me) returns Real from Standard;
---Purpose: Returns the maximum angle between the result and the
-- constraints. This is set at construction time.
G0Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the maximum distance attained between the
-- result and the constraint Index. This is set at construction time.
G1Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the maximum angle between the result and the
-- constraints. This is set at construction time.
G2Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the greatest difference in curvature found
-- between the result and the constraint Index.
fields
myFilling : Filling from BRepFill;
end MakeFilling;

View File

@@ -14,8 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakeFilling.ixx>
#include <BRepOffsetAPI_MakeFilling.hxx>
#include <gp_Pnt.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : Constructor

View File

@@ -0,0 +1,243 @@
// Created on: 1998-08-26
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-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_MakeFilling_HeaderFile
#define _BRepOffsetAPI_MakeFilling_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_Filling.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_ConstructionError;
class TopoDS_Face;
class TopoDS_Edge;
class gp_Pnt;
class TopoDS_Shape;
//! N-Side Filling
//! This algorithm avoids to build a face from:
//! * a set of edges defining the bounds of the face and some
//! constraints the surface of the face has to satisfy
//! * a set of edges and points defining some constraints
//! the support surface has to satisfy
//! * an initial surface to deform for satisfying the constraints
//! * a set of parameters to control the constraints.
//!
//! The support surface of the face is computed by deformation
//! of the initial surface in order to satisfy the given constraints.
//! The set of bounding edges defines the wire of the face.
//!
//! If no initial surface is given, the algorithm computes it
//! automatically.
//! If the set of edges is not connected (Free constraint)
//! missing edges are automatically computed.
//!
//! Limitations:
//! * If some constraints are not compatible
//! The algorithm does not take them into account.
//! So the constraints will not be satisfyed in an area containing
//! the incompatibilitries.
//! * The constraints defining the bound of the face have to be
//! entered in order to have a continuous wire.
//!
//! Other Applications:
//! * Deformation of a face to satisfy internal constraints
//! * Deformation of a face to improve Gi continuity with
//! connected faces
class BRepOffsetAPI_MakeFilling : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a wire filling object defined by
//! - the energy minimizing criterion Degree
//! - the number of points on the curve NbPntsOnCur
//! - the number of iterations NbIter
//! - the Boolean Anisotropie
//! - the 2D tolerance Tol2d
//! - the 3D tolerance Tol3d
//! - the angular tolerance TolAng
//! - the tolerance for curvature TolCur
//! - the highest polynomial degree MaxDeg
//! - the greatest number of segments MaxSeg.
//! If the Boolean Anistropie is true, the algorithm's
//! performance is better in cases where the ratio of the
//! length U and the length V indicate a great difference
//! between the two. In other words, when the surface is, for
//! example, extremely long.
Standard_EXPORT BRepOffsetAPI_MakeFilling(const Standard_Integer Degree = 3, const Standard_Integer NbPtsOnCur = 15, const Standard_Integer NbIter = 2, const Standard_Boolean Anisotropie = Standard_False, const Standard_Real Tol2d = 0.00001, const Standard_Real Tol3d = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1, const Standard_Integer MaxDeg = 8, const Standard_Integer MaxSegments = 9);
//! Sets the values of Tolerances used to control the constraint.
//! Tol2d:
//! Tol3d: it is the maximum distance allowed between the support surface
//! and the constraints
//! TolAng: it is the maximum angle allowed between the normal of the surface
//! and the constraints
//! TolCurv: it is the maximum difference of curvature allowed between
//! the surface and the constraint
Standard_EXPORT void SetConstrParam (const Standard_Real Tol2d = 0.00001, const Standard_Real Tol3d = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
//! Sets the parameters used for resolution.
//! The default values of these parameters have been chosen for a good
//! ratio quality/performance.
//! Degree: it is the order of energy criterion to minimize for computing
//! the deformation of the surface.
//! The default value is 3
//! The recommanded value is i+2 where i is the maximum order of the
//! constraints.
//! NbPtsOnCur: it is the average number of points for discretisation
//! of the edges.
//! NbIter: it is the maximum number of iterations of the process.
//! For each iteration the number of discretisation points is
//! increased.
//! Anisotropie:
Standard_EXPORT void SetResolParam (const Standard_Integer Degree = 3, const Standard_Integer NbPtsOnCur = 15, const Standard_Integer NbIter = 2, const Standard_Boolean Anisotropie = Standard_False);
//! Sets the parameters used to approximate the filling
//! surface. These include:
//! - MaxDeg - the highest degree which the polynomial
//! defining the filling surface can have
//! - MaxSegments - the greatest number of segments
//! which the filling surface can have.
Standard_EXPORT void SetApproxParam (const Standard_Integer MaxDeg = 8, const Standard_Integer MaxSegments = 9);
//! Loads the initial surface Surf to
//! begin the construction of the surface.
//! This optional function is useful if the surface resulting from
//! construction for the algorithm is likely to be complex.
//! The support surface of the face under construction is computed by a
//! deformation of Surf which satisfies the given constraints.
//! The set of bounding edges defines the wire of the face.
//! If no initial surface is given, the algorithm computes it
//! automatically. If the set of edges is not connected (Free constraint),
//! missing edges are automatically computed.
//! Important: the initial surface must have orthogonal local coordinates,
//! i.e. partial derivatives dS/du and dS/dv must be orthogonal
//! at each point of surface.
//! If this condition breaks, distortions of resulting surface
//! are possible.
Standard_EXPORT void LoadInitSurface (const TopoDS_Face& Surf);
//! Adds a new constraint which also defines an edge of the wire
//! of the face
//! Order: Order of the constraint:
//! GeomAbs_C0 : the surface has to pass by 3D representation
//! of the edge
//! GeomAbs_G1 : the surface has to pass by 3D representation
//! of the edge and to respect tangency with the first
//! face of the edge
//! GeomAbs_G2 : the surface has to pass by 3D representation
//! of the edge and to respect tangency and curvature
//! with the first face of the edge.
//! Raises ConstructionError if the edge has no representation on a face and Order is
//! GeomAbs_G1 or GeomAbs_G2.
Standard_EXPORT Standard_Integer Add (const TopoDS_Edge& Constr, const GeomAbs_Shape Order, const Standard_Boolean IsBound = Standard_True);
//! Adds a new constraint which also defines an edge of the wire
//! of the face
//! Order: Order of the constraint:
//! GeomAbs_C0 : the surface has to pass by 3D representation
//! of the edge
//! GeomAbs_G1 : the surface has to pass by 3D representation
//! of the edge and to respect tangency with the
//! given face
//! GeomAbs_G2 : the surface has to pass by 3D representation
//! of the edge and to respect tangency and curvature
//! with the given face.
//! Raises ConstructionError if the edge has no 2d representation on the given face
Standard_EXPORT Standard_Integer Add (const TopoDS_Edge& Constr, const TopoDS_Face& Support, const GeomAbs_Shape Order, const Standard_Boolean IsBound = Standard_True);
//! Adds a free constraint on a face. The corresponding edge has to
//! be automatically recomputed. It is always a bound.
Standard_EXPORT Standard_Integer Add (const TopoDS_Face& Support, const GeomAbs_Shape Order);
//! Adds a punctual constraint.
Standard_EXPORT Standard_Integer Add (const gp_Pnt& Point);
//! Adds a punctual constraint.
Standard_EXPORT Standard_Integer Add (const Standard_Real U, const Standard_Real V, const TopoDS_Face& Support, const GeomAbs_Shape Order);
//! Builds the resulting faces
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Tests whether computation of the filling plate has been completed.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the maximum distance between the result and
//! the constraints. This is set at construction time.
Standard_EXPORT Standard_Real G0Error() const;
//! Returns the maximum angle between the result and the
//! constraints. This is set at construction time.
Standard_EXPORT Standard_Real G1Error() const;
//! Returns the maximum angle between the result and the
//! constraints. This is set at construction time.
Standard_EXPORT Standard_Real G2Error() const;
//! Returns the maximum distance attained between the
//! result and the constraint Index. This is set at construction time.
Standard_EXPORT Standard_Real G0Error (const Standard_Integer Index);
//! Returns the maximum angle between the result and the
//! constraints. This is set at construction time.
Standard_EXPORT Standard_Real G1Error (const Standard_Integer Index);
//! Returns the greatest difference in curvature found
//! between the result and the constraint Index.
Standard_EXPORT Standard_Real G2Error (const Standard_Integer Index);
protected:
private:
BRepFill_Filling myFilling;
};
#endif // _BRepOffsetAPI_MakeFilling_HeaderFile

View File

@@ -1,115 +0,0 @@
-- Created on: 1995-09-18
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakeOffset from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes algorithms for offsetting wires from a set of
-- wires contained in a planar face.
-- A MakeOffset object provides a framework for:
-- - defining the construction of an offset,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses
Shape from TopoDS,
Wire from TopoDS,
Face from TopoDS,
ListOfShape from TopTools,
OffsetWire from BRepFill,
ListOfOffsetWire from BRepFill,
JoinType from GeomAbs
raises
NotDone from StdFail
is
Create returns MakeOffset from BRepOffsetAPI;
---Purpose: Constructs an algorithm for creating an empty offset
Create( Spine : Face from TopoDS;
Join : JoinType from GeomAbs = GeomAbs_Arc;
IsOpenResult : Boolean from Standard = Standard_False)
returns MakeOffset from BRepOffsetAPI;
---Purpose: Constructs an algorithm for creating an algorithm
-- to build parallels to the spine Spine
Init( me : in out;
Spine : Face from TopoDS;
Join : JoinType from GeomAbs = GeomAbs_Arc;
IsOpenResult : Boolean from Standard = Standard_False)
---Purpose: Initializes the algorithm to construct parallels to the spine Spine.
-- Join defines the type of parallel generated by the
-- salient vertices of the spine.
-- The default type is GeomAbs_Arc where the vertices generate
-- sections of a circle.
-- If join type is GeomAbs_Intersection, the edges that
-- intersect in a salient vertex generate the edges
-- prolonged until intersection.
is static;
Create( Spine : Wire from TopoDS;
Join : JoinType from GeomAbs = GeomAbs_Arc;
IsOpenResult : Boolean from Standard = Standard_False)
returns MakeOffset from BRepOffsetAPI;
Init( me : in out;
Join : JoinType from GeomAbs = GeomAbs_Arc;
IsOpenResult : Boolean from Standard = Standard_False)
---Purpose: Initialize the evaluation of Offseting.
is static;
AddWire (me : in out;
Spine : Wire from TopoDS)
---Purpose: Initializes the algorithm to construct parallels to the wire Spine.
is static;
Perform (me : in out;
Offset : Real from Standard;
Alt : Real from Standard = 0.0)
---Purpose: Computes a parallel to the spine at distance Offset and
-- at an altitude Alt from the plane of the spine in relation
-- to the normal to the spine.
-- Exceptions: StdFail_NotDone if the offset is not built.
raises
NotDone from StdFail
is static;
Build(me : in out)
is redefined;
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
Generated (me: in out; S : Shape from TopoDS)
---Purpose: returns a list of the created shapes
-- from the shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined;
fields
myIsInitialized : Boolean from Standard;
myLastIsLeft : Boolean from Standard;
myJoin : JoinType from GeomAbs;
myIsOpenResult : Boolean from Standard;
myFace : Face from TopoDS;
myWires : ListOfShape from TopTools;
myLeft : ListOfOffsetWire from BRepFill;
myRight : ListOfOffsetWire from BRepFill;
end MakeOffset;

View File

@@ -14,28 +14,31 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakeOffset.ixx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAlgo_FaceRestrictor.hxx>
#include <Extrema_ExtPS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepFill_OffsetWire.hxx>
#include <BRepAlgo_FaceRestrictor.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepFill_ListIteratorOfListOfOffsetWire.hxx>
#include <BRepFill_OffsetWire.hxx>
#include <BRepOffsetAPI_MakeOffset.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <gp_Pnt2d.hxx>
#include <Extrema_ExtPS.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Precision.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Wire.hxx>
#include <StdFail_NotDone.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifdef OCCT_DEBUG
#include <BRepTools.hxx>
static Standard_Boolean AffichSpine = Standard_False;

View File

@@ -0,0 +1,119 @@
// Created on: 1995-09-18
// Created by: Bruno DUMORTIER
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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_MakeOffset_HeaderFile
#define _BRepOffsetAPI_MakeOffset_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_JoinType.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepFill_ListOfOffsetWire.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class TopoDS_Face;
class TopoDS_Wire;
class TopoDS_Shape;
//! Describes algorithms for offsetting wires from a set of
//! wires contained in a planar face.
//! A MakeOffset object provides a framework for:
//! - defining the construction of an offset,
//! - implementing the construction algorithm, and
//! - consulting the result.
class BRepOffsetAPI_MakeOffset : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an algorithm for creating an empty offset
Standard_EXPORT BRepOffsetAPI_MakeOffset();
//! Constructs an algorithm for creating an algorithm
//! to build parallels to the spine Spine
Standard_EXPORT BRepOffsetAPI_MakeOffset(const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
//! Initializes the algorithm to construct parallels to the spine Spine.
//! Join defines the type of parallel generated by the
//! salient vertices of the spine.
//! The default type is GeomAbs_Arc where the vertices generate
//! sections of a circle.
//! If join type is GeomAbs_Intersection, the edges that
//! intersect in a salient vertex generate the edges
//! prolonged until intersection.
Standard_EXPORT void Init (const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
Standard_EXPORT BRepOffsetAPI_MakeOffset(const TopoDS_Wire& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
//! Initialize the evaluation of Offseting.
Standard_EXPORT void Init (const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
//! Initializes the algorithm to construct parallels to the wire Spine.
Standard_EXPORT void AddWire (const TopoDS_Wire& Spine);
//! Computes a parallel to the spine at distance Offset and
//! at an altitude Alt from the plane of the spine in relation
//! to the normal to the spine.
//! Exceptions: StdFail_NotDone if the offset is not built.
Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0);
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! returns a list of the created shapes
//! from the shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
Standard_Boolean myIsInitialized;
Standard_Boolean myLastIsLeft;
GeomAbs_JoinType myJoin;
Standard_Boolean myIsOpenResult;
TopoDS_Face myFace;
TopTools_ListOfShape myWires;
BRepFill_ListOfOffsetWire myLeft;
BRepFill_ListOfOffsetWire myRight;
};
#endif // _BRepOffsetAPI_MakeOffset_HeaderFile

View File

@@ -1,149 +0,0 @@
-- Created on: 1996-02-13
-- Created by: Yves FRICAUD
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-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.
-- Modified by skv - Tue Mar 15 16:17:37 2005
-- Add methods for supporting history.
class MakeOffsetShape from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build a shell out of a shape. The
-- result is an unlooped shape parallel to the source shape.
-- A MakeOffsetShape object provides a framework for:
-- - defining the construction of a shell
-- - implementing the construction algorithm
-- - consulting the result.
uses
MakeOffset from BRepOffset,
Mode from BRepOffset,
Shape from TopoDS,
Face from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
ListOfShape from TopTools,
JoinType from GeomAbs
is
Create returns MakeOffsetShape from BRepOffsetAPI;
Create ( S : Shape from TopoDS;
Offset : Real from Standard;
Tol : Real from Standard;
Mode : Mode from BRepOffset = BRepOffset_Skin;
Intersection : Boolean from Standard = Standard_False;
SelfInter : Boolean from Standard = Standard_False;
Join : JoinType from GeomAbs = GeomAbs_Arc)
---Purpose: Constructs a shape parallel to the shape S, where
-- - S may be a face, a shell, a solid or a compound of these shape kinds;
-- - Offset is the offset value. The offset shape is constructed:
-- - outside S, if Offset is positive,
-- - inside S, if Offset is negative;
-- - Tol defines the coincidence tolerance criterion for generated shapes;
-- - Mode defines the construction type of parallels
-- applied to the free edges of shape S; currently, only one
-- construction type is implemented, namely the one where the free
-- edges do not generate parallels; this corresponds to the default
-- value BRepOffset_Skin;
-- - Intersection specifies how the algorithm must work in
-- order to limit the parallels to two adjacent shapes:
-- - if Intersection is false (default value), the intersection
-- is calculated with the parallels to the two adjacent shapes,
-- - if Intersection is true, the intersection is calculated by
-- taking all generated parallels into account; this computation method is
-- more general as it avoids some self-intersections generated in the
-- offset shape from features of small dimensions on shape S, however this
-- method has not been completely implemented and therefore is not
-- recommended for use;
-- - SelfInter tells the algorithm whether a computation
-- to eliminate self-intersections must be applied to the resulting
-- shape; however, as this functionality is not yet
-- implemented, it is recommended to use the default value (false);
-- - Join defines how to fill the holes that may appear between
-- parallels to the two adjacent faces. It may take values
-- GeomAbs_Arc or GeomAbs_Intersection:
-- - if Join is equal to GeomAbs_Arc, then pipes are generated
-- between two free edges of two adjacent parallels,
-- and spheres are generated on "images" of vertices;
-- it is the default value,
-- - if Join is equal to GeomAbs_Intersection, then the parallels to the
-- two adjacent faces are enlarged and intersected,
-- so that there are no free edges on parallels to faces.
-- Warnings
-- 1. All the faces of the shape S should be based on the surfaces
-- with continuity at least C1.
-- 2. The offset value should be sufficiently small to avoid
-- self-intersections in resulting shape. Otherwise these
-- self-intersections may appear inside an offset face if its
-- initial surface is not plane or sphere or cylinder, also some
-- non-adjacent offset faces may intersect each other. Also, some
-- offset surfaces may "turn inside out".
-- 3. The algorithm may fail if the shape S contains vertices where
-- more than 3 edges converge.
-- 4. Since 3d-offset algorithm involves intersection of surfaces,
-- it is under limitations of surface intersection algorithm.
-- 5. A result cannot be generated if the underlying geometry of S is
-- BSpline with continuity C0.
-- Exceptions
-- Geom_UndefinedDerivative if the underlying
-- geometry of S is BSpline with continuity C0.
returns MakeOffsetShape from BRepOffsetAPI;
MakeOffset (me) returns MakeOffset from BRepOffset
---C++: return const &
---Level: Advanced
is virtual;
Build (me : in out)
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
is redefined;
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
-- Modified by skv - Tue Mar 15 16:17:37 2005 Begin
-- Add methods for supporting history.
GeneratedEdge (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of edges generated from the shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools;
-- Query offset join type.
GetJoinType(me)
---Purpose: Returns offset join type.
returns JoinType from GeomAbs
is static;
-- Modified by skv - Tue Mar 15 16:17:37 2005 End
fields
myOffsetShape : MakeOffset from BRepOffset is protected;
end MakeOffsetShape;

View File

@@ -17,16 +17,16 @@
// Modified by skv - Tue Mar 15 16:20:43 2005
// Add methods for supporting history.
#include <BRepOffsetAPI_MakeOffsetShape.ixx>
#include <BRepOffset_MakeOffset.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepOffsetAPI_MakeOffsetShape.hxx>
#include <Standard_ConstructionError.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//=======================================================================
//function : BRepOffsetAPI_MakeOffsetShape
//purpose :
//=======================================================================
BRepOffsetAPI_MakeOffsetShape::BRepOffsetAPI_MakeOffsetShape()
{
}

View File

@@ -0,0 +1,144 @@
// Created on: 1996-02-13
// Created by: Yves FRICAUD
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-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_MakeOffsetShape_HeaderFile
#define _BRepOffsetAPI_MakeOffsetShape_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepOffset_MakeOffset.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <BRepOffset_Mode.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_JoinType.hxx>
#include <TopTools_ListOfShape.hxx>
class TopoDS_Shape;
class BRepOffset_MakeOffset;
//! Describes functions to build a shell out of a shape. The
//! result is an unlooped shape parallel to the source shape.
//! A MakeOffsetShape object provides a framework for:
//! - defining the construction of a shell
//! - implementing the construction algorithm
//! - consulting the result.
class BRepOffsetAPI_MakeOffsetShape : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepOffsetAPI_MakeOffsetShape();
//! Constructs a shape parallel to the shape S, where
//! - S may be a face, a shell, a solid or a compound of these shape kinds;
//! - Offset is the offset value. The offset shape is constructed:
//! - outside S, if Offset is positive,
//! - inside S, if Offset is negative;
//! - Tol defines the coincidence tolerance criterion for generated shapes;
//! - Mode defines the construction type of parallels
//! applied to the free edges of shape S; currently, only one
//! construction type is implemented, namely the one where the free
//! edges do not generate parallels; this corresponds to the default
//! value BRepOffset_Skin;
//! - Intersection specifies how the algorithm must work in
//! order to limit the parallels to two adjacent shapes:
//! - if Intersection is false (default value), the intersection
//! is calculated with the parallels to the two adjacent shapes,
//! - if Intersection is true, the intersection is calculated by
//! taking all generated parallels into account; this computation method is
//! more general as it avoids some self-intersections generated in the
//! offset shape from features of small dimensions on shape S, however this
//! method has not been completely implemented and therefore is not
//! recommended for use;
//! - SelfInter tells the algorithm whether a computation
//! to eliminate self-intersections must be applied to the resulting
//! shape; however, as this functionality is not yet
//! implemented, it is recommended to use the default value (false);
//! - Join defines how to fill the holes that may appear between
//! parallels to the two adjacent faces. It may take values
//! GeomAbs_Arc or GeomAbs_Intersection:
//! - if Join is equal to GeomAbs_Arc, then pipes are generated
//! between two free edges of two adjacent parallels,
//! and spheres are generated on "images" of vertices;
//! it is the default value,
//! - if Join is equal to GeomAbs_Intersection, then the parallels to the
//! two adjacent faces are enlarged and intersected,
//! so that there are no free edges on parallels to faces.
//! Warnings
//! 1. All the faces of the shape S should be based on the surfaces
//! with continuity at least C1.
//! 2. The offset value should be sufficiently small to avoid
//! self-intersections in resulting shape. Otherwise these
//! self-intersections may appear inside an offset face if its
//! initial surface is not plane or sphere or cylinder, also some
//! non-adjacent offset faces may intersect each other. Also, some
//! offset surfaces may "turn inside out".
//! 3. The algorithm may fail if the shape S contains vertices where
//! more than 3 edges converge.
//! 4. Since 3d-offset algorithm involves intersection of surfaces,
//! it is under limitations of surface intersection algorithm.
//! 5. A result cannot be generated if the underlying geometry of S is
//! BSpline with continuity C0.
//! Exceptions
//! Geom_UndefinedDerivative if the underlying
//! geometry of S is BSpline with continuity C0.
Standard_EXPORT BRepOffsetAPI_MakeOffsetShape(const TopoDS_Shape& S, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc);
Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const;
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the list of edges generated from the shape <S>.
Standard_EXPORT const TopTools_ListOfShape& GeneratedEdge (const TopoDS_Shape& S);
//! Returns offset join type.
Standard_EXPORT GeomAbs_JoinType GetJoinType() const;
protected:
BRepOffset_MakeOffset myOffsetShape;
private:
};
#endif // _BRepOffsetAPI_MakeOffsetShape_HeaderFile

View File

@@ -1,102 +0,0 @@
-- Created on: 1994-07-12
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakePipe from BRepOffsetAPI inherits MakeSweep from BRepPrimAPI
---Purpose: Describes functions to build pipes.
-- A pipe is built a basis shape (called the profile) along
-- a wire (called the spine) by sweeping.
-- The profile must not contain solids.
-- A MakePipe object provides a framework for:
-- - defining the construction of a pipe,
-- - implementing the construction algorithm, and
-- - consulting the result.
-- Warning
-- The MakePipe class implements pipe constructions
-- with G1 continuous spines only.
uses
Pipe from BRepFill,
Trihedron from GeomFill,
Wire from TopoDS,
Shape from TopoDS,
Edge from TopoDS,
ListOfShape from TopTools
is
Create( Spine : Wire from TopoDS;
Profile : Shape from TopoDS )
---Purpose: Constructs a pipe by sweeping the shape Profile along
-- the wire Spine.The angle made by the spine with the profile is
-- maintained along the length of the pipe.
-- Warning
-- Spine must be G1 continuous; that is, on the connection
-- vertex of two edges of the wire, the tangent vectors on
-- the left and on the right must have the same direction,
-- though not necessarily the same magnitude.
-- Exceptions
-- Standard_DomainError if the profile is a solid or a
-- composite solid.
returns MakePipe from BRepOffsetAPI;
Create( Spine : Wire from TopoDS;
Profile : Shape from TopoDS;
aMode : Trihedron from GeomFill;
ForceApproxC1 : Boolean from Standard = Standard_False)
---Purpose: the same as previous but with setting of
-- mode of sweep and the flag that indicates attempt
-- to approximate a C1-continuous surface if a swept
-- surface proved to be C0.
returns MakePipe from BRepOffsetAPI;
Pipe(me) returns Pipe from BRepFill
---C++: return const &
---Level: Advanced
is static;
Build(me : in out)
is redefined;
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
FirstShape (me : in out)
---Purpose: Returns the TopoDS Shape of the bottom of the prism.
returns Shape from TopoDS;
LastShape (me : in out)
---Purpose: Returns the TopoDS Shape of the top of the prism.
returns Shape from TopoDS;
Generated (me: in out; SSpine, SProfile : Shape from TopoDS)
---Level: Public
returns Shape from TopoDS;
ErrorOnSurface (me)
---Level: Public
returns Real from Standard;
fields
myPipe : Pipe from BRepFill;
end MakePipe;

View File

@@ -14,22 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakePipe.ixx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS.hxx>
#include <BRepFill_Pipe.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
//=======================================================================
//function : BRepOffsetAPI_MakePipe
//purpose : constructor
//=======================================================================
BRepOffsetAPI_MakePipe::BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine ,
const TopoDS_Shape& Profile)
: myPipe(Spine, Profile)

View File

@@ -0,0 +1,110 @@
// Created on: 1994-07-12
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-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_MakePipe_HeaderFile
#define _BRepOffsetAPI_MakePipe_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_Pipe.hxx>
#include <BRepPrimAPI_MakeSweep.hxx>
#include <GeomFill_Trihedron.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class TopoDS_Wire;
class TopoDS_Shape;
class BRepFill_Pipe;
//! Describes functions to build pipes.
//! A pipe is built a basis shape (called the profile) along
//! a wire (called the spine) by sweeping.
//! The profile must not contain solids.
//! A MakePipe object provides a framework for:
//! - defining the construction of a pipe,
//! - implementing the construction algorithm, and
//! - consulting the result.
//! Warning
//! The MakePipe class implements pipe constructions
//! with G1 continuous spines only.
class BRepOffsetAPI_MakePipe : public BRepPrimAPI_MakeSweep
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a pipe by sweeping the shape Profile along
//! the wire Spine.The angle made by the spine with the profile is
//! maintained along the length of the pipe.
//! Warning
//! Spine must be G1 continuous; that is, on the connection
//! vertex of two edges of the wire, the tangent vectors on
//! the left and on the right must have the same direction,
//! though not necessarily the same magnitude.
//! Exceptions
//! Standard_DomainError if the profile is a solid or a
//! composite solid.
Standard_EXPORT BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine, const TopoDS_Shape& Profile);
//! the same as previous but with setting of
//! mode of sweep and the flag that indicates attempt
//! to approximate a C1-continuous surface if a swept
//! surface proved to be C0.
Standard_EXPORT BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine, const TopoDS_Shape& Profile, const GeomFill_Trihedron aMode, const Standard_Boolean ForceApproxC1 = Standard_False);
Standard_EXPORT const BRepFill_Pipe& Pipe() const;
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns the TopoDS Shape of the bottom of the prism.
Standard_EXPORT TopoDS_Shape FirstShape();
//! Returns the TopoDS Shape of the top of the prism.
Standard_EXPORT TopoDS_Shape LastShape();
Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& SSpine, const TopoDS_Shape& SProfile);
Standard_EXPORT Standard_Real ErrorOnSurface() const;
protected:
private:
BRepFill_Pipe myPipe;
};
#endif // _BRepOffsetAPI_MakePipe_HeaderFile

View File

@@ -1,362 +0,0 @@
-- Created on: 1998-04-08
-- Created by: Philippe MANGIN
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakePipeShell from BRepOffsetAPI inherits MakeSweep from BRepPrimAPI
---Purpose: This class provides for a framework to construct a shell
-- or a solid along a spine consisting in a wire.
-- To produce a solid, the initial wire must be closed.
-- Two approaches are used:
-- - definition by section
-- - by a section and a scaling law
-- - by addition of successive intermediary sections
-- - definition by sweep mode.
-- - pseudo-Frenet
-- - constant
-- - binormal constant
-- - normal defined by a surface support
-- - normal defined by a guiding contour.
-- The two global approaches can also be combined.
-- You can also close the surface later in order to form a solid.
-- Warning: In this version some limitation exist
-- -- We can add only 1 Section (else Standard_NotImplemented is raised
-- -- Mode with auxilary spine is incompatible with hometetic laws
-- -- Mode with auxilary spine and keep contact produce only CO surface.
-- -- Transition treatement is implemented only with the option <BRepBuilderAPI_Transformed>
-- Normaly all these limitations have to be deleted in mext version.
uses
Dir from gp,
Ax2 from gp,
Function from Law,
ListOfShape from TopTools,
Shape from TopoDS,
Wire from TopoDS,
Vertex from TopoDS,
TransitionMode from BRepBuilderAPI,
PipeError from BRepBuilderAPI,
PipeShell from BRepFill,
TypeOfContact from BRepFill
raises
DomainError from Standard,
NotDone from StdFail
is
Create( Spine : Wire from TopoDS)
--- Purpose: Constructs the shell-generating framework defined by the wire Spine.
returns MakePipeShell from BRepOffsetAPI;
---Purpose: Sets an sweep's mode
-- If no mode are setted, the mode use in MakePipe is used
---See Also: GeomFill_IsCorrectedFrenet
SetMode(me : in out; IsFrenet : Boolean = Standard_False);
---Purpose: Sets a Frenet or a CorrectedFrenet trihedron
-- to perform the sweeping
-- If IsFrenet is false, a corrected Frenet trihedron is used.
SetDiscreteMode(me : in out);
---Purpose: Sets a Discrete trihedron
-- to perform the sweeping
SetMode(me : in out; Axe : Ax2 from gp);
---Purpose: Sets a fixed trihedron to perform the sweeping
-- all sections will be parallel.
SetMode(me : in out; BiNormal : Dir from gp);
---Purpose: Sets a fixed BiNormal direction to perform the --
-- sweeping. Angular relations beetween the
-- section(s) and <BiNormal> will be constant
SetMode(me : in out; SpineSupport : Shape from TopoDS)
---Purpose: Sets support to the spine to define the BiNormal of
-- the trihedron, like the normal to the surfaces.
-- Warning: To be effective, Each edge of the <spine> must
-- have an representaion on one face of<SpineSupport>
returns Boolean;
SetMode(me : in out;
AuxiliarySpine : Wire from TopoDS;
CurvilinearEquivalence : Boolean;
KeepContact : TypeOfContact from BRepFill = BRepFill_NoContact );
---Purpose: Sets an auxiliary spine to define the Normal
-- For each Point of the Spine P, an Point Q is evalued
-- on <AuxiliarySpine>
-- If <CurvilinearEquivalence>
-- Q split <AuxiliarySpine> with the same length ratio
-- than P split <Spline>.
-- Else the plan define by P and the tangent to the <Spine>
-- intersect <AuxiliarySpine> in Q.
-- If <KeepContact> equals BRepFill_NoContact: The Normal is defined
-- by the vector PQ.
-- If <KeepContact> equals BRepFill_Contact: The Normal is defined to
-- achieve that the sweeped section is in contact to the
-- auxiliarySpine. The width of section is constant all along the path.
-- In other words, the auxiliary spine lies on the swept surface,
-- but not necessarily is a boundary of this surface. However,
-- the auxiliary spine has to be close enough to the main spine
-- to provide intersection with any section all along the path.
-- If <KeepContact> equals BRepFill_ContactOnBorder: The auxiliary spine
-- becomes a boundary of the swept surface and the width of section varies
-- along the path.
---Level: Public
-- =================================
-- Methodes to define section(s)
-- =================================
---Purpose: Give section to sweep.
-- Possibilities are :
-- - Give one or sevral section
-- - Give one profile and an homotetic law.
-- - Automatic compute of correspondance beetween spine, and section
-- on the sweeped shape
-- - correspondance beetween spine, and section on the sweeped shape
-- defined by a vertex of the spine
-- Option is :
-- -"WithContact" : The section is translated to be in
-- contact with the spine
-- -"WithCorrection" The section is rotated to have a Normal --
-- parallel to the trihedron's normal and have tangent
-- perpendicular to the trihedron's tangent.
Add(me:in out;
Profile : Shape from TopoDS;
WithContact : Boolean = Standard_False;
WithCorrection : Boolean = Standard_False );
---Purpose: Adds the section Profile to this framework. First and last
-- sections may be punctual, so the shape Profile may be
-- both wire and vertex. Correspondent point on spine is
-- computed automatically.
-- If WithContact is true, the section is translated to be in
-- contact with the spine.
-- If WithCorrection is true, the section is rotated to be
-- orthogonal to the spine?s tangent in the correspondent
-- point. This option has no sense if the section is punctual
-- (Profile is of type TopoDS_Vertex).
Add(me:in out;
Profile : Shape from TopoDS;
Location : Vertex from TopoDS;
WithContact : Boolean = Standard_False;
WithCorrection : Boolean = Standard_False)
---Purpose: Adds the section Profile to this framework.
-- Correspondent point on the spine is given by Location.
-- Warning:
-- To be effective, it is not recommended to combine methods Add and SetLaw.
raises DomainError;
SetLaw(me :in out;
Profile : Shape from TopoDS;
L : Function from Law;
WithContact : Boolean = Standard_False;
WithCorrection : Boolean = Standard_False);
---Purpose: Sets the evolution law defined by the wire Profile with
-- its position (Location, WithContact, WithCorrection
-- are the same options as in methods Add) and a
-- homotetic law defined by the function L.
-- Warning:
-- To be effective, it is not recommended to combine methods Add and SetLaw.
SetLaw(me :in out;
Profile : Shape from TopoDS;
L : Function from Law;
Location : Vertex from TopoDS;
WithContact : Boolean = Standard_False;
WithCorrection : Boolean = Standard_False);
---Purpose: Sets the evolution law defined by the wire Profile with
-- its position (Location, WithContact, WithCorrection
-- are the same options as in methods Add) and a
-- homotetic law defined by the function L.
-- Warning:
-- To be effective, it is not recommended to combine methods Add and SetLaw.
Delete(me : in out; Profile : Shape) ;
---Purpose: Removes the section Profile from this framework.
-- ========================================
-- Methodes to perform and read shape
-- ========================================
IsReady(me)
---Purpose: Returns true if this tool object is ready to build the
-- shape, i.e. has a definition for the wire section Profile.
returns Boolean;
GetStatus(me)
---Purpose: Get a status, when Simulate or Build failed. It can be
-- BRepBuilderAPI_PipeDone,
-- BRepBuilderAPI_PipeNotDone,
-- BRepBuilderAPI_PlaneNotIntersectGuide,
-- BRepBuilderAPI_ImpossibleContact.
returns PipeError from BRepBuilderAPI;
SetTolerance(me : in out;
Tol3d : Real = 1.0e-4;
BoundTol : Real = 1.0e-4;
TolAngular : Real = 1.0e-2);
---Purpose: Sets the following tolerance values
-- - 3D tolerance Tol3d
-- - boundary tolerance BoundTol
-- - angular tolerance TolAngular.
-- ============================================
-- Methods to set parameters for approximation
-- ============================================
SetMaxDegree(me : in out;
NewMaxDegree : Integer from Standard);
---Purpose: Define the maximum V degree of resulting surface
SetMaxSegments(me : in out;
NewMaxSegments : Integer from Standard);
---Purpose: Define the maximum number of spans in V-direction
-- on resulting surface
SetForceApproxC1(me : in out;
ForceApproxC1 : Boolean from Standard);
---Purpose: Set the flag that indicates attempt to approximate
-- a C1-continuous surface if a swept surface proved
-- to be C0.
SetTransitionMode(me : in out;
Mode :TransitionMode from BRepBuilderAPI = BRepBuilderAPI_Transformed)
---Purpose: Sets the transition mode to manage discontinuities on
-- the swept shape caused by fractures on the spine. The
-- transition mode can be BRepBuilderAPI_Transformed
-- (default value), BRepBuilderAPI_RightCorner,
-- BRepBuilderAPI_RoundCorner:
-- - RepBuilderAPI_Transformed:
-- discontinuities are treated by
-- modification of the sweeping mode. The
-- pipe is "transformed" at the fractures of
-- the spine. This mode assumes building a
-- self-intersected shell.
-- - BRepBuilderAPI_RightCorner:
-- discontinuities are treated like right
-- corner. Two pieces of the pipe
-- corresponding to two adjacent
-- segments of the spine are extended
-- and intersected at a fracture of the spine.
-- - BRepBuilderAPI_RoundCorner:
-- discontinuities are treated like round
-- corner. The corner is treated as rotation
-- of the profile around an axis which
-- passes through the point of the spine?s
-- fracture. This axis is based on cross
-- product of directions tangent to the
-- adjacent segments of the spine at their common point.
-- Warnings
-- The mode BRepBuilderAPI_RightCorner provides a
-- valid result if intersection of two pieces of the pipe
-- (corresponding to two adjacent segments of the spine)
-- in the neighborhood of the spine?s fracture is
-- connected and planar. This condition can be violated if
-- the spine is non-linear in some neighborhood of the
-- fracture or if the profile was set with a scaling law.
-- The last mode, BRepBuilderAPI_RoundCorner, will
-- assuredly provide a good result only if a profile was set
-- with option WithCorrection = True, i.e. it is strictly
-- orthogonal to the spine.
is static;
Simulate(me : in out;
NumberOfSection : Integer;
Result : out ListOfShape from TopTools)
---Purpose: Simulates the resulting shape by calculating its
-- cross-sections. The spine is devided by this
-- cross-sections into (NumberOfSection - 1) equal
-- parts, the number of cross-sections is
-- NumberOfSection. The cross-sections are wires and
-- they are returned in the list Result.
-- This gives a rapid preview of the resulting shape,
-- which will be obtained using the settings you have provided.
-- Raises NotDone if <me> it is not Ready
raises NotDone;
Build(me : in out)
---Purpose: Builds the resulting shape (redefined from MakeShape).
---Level: Public
raises NotDone -- If <me> it is not Ready
is redefined;
MakeSolid(me : in out)
---Purpose: Transforms the sweeping Shell in Solid.
-- If a propfile is not closed returns False
returns Boolean
raises NotDone;
FirstShape (me : in out)
---Purpose: Returns the TopoDS Shape of the bottom of the sweep.
returns Shape from TopoDS
is redefined;
LastShape (me : in out)
---Purpose: Returns the TopoDS Shape of the top of the sweep.
returns Shape from TopoDS
is redefined;
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns a list of new shapes generated from the shape
-- S by the shell-generating algorithm.
-- This function is redefined from BRepOffsetAPI_MakeShape::Generated.
-- S can be an edge of the given Spine (see Constructor),
-- it can be an edge or a boundary vertex of a shape
-- returned by the method FirstShape(), it can also be a
-- Profile (see method Add()) closest to the beginning or
-- the end of the Spine.
-- If S is an edge of the given Spine, then method
-- Generated() returns a list of generated faces and a list
-- of edges from a free boundary (if it exists) of the
-- resulting shell.
-- If S is an edge of the start shape (see FirstShape()),
-- method Generated() returns a list of faces generated
-- along the whole spine from the given edge.
-- If S is a boundary vertex of the start shape (see
-- FirstShape()), method Generated() returns a list of
-- edges from the free boundary of the resulting shell,
-- generated along the whole spine.
-- If S is a Profile closest to the beginning of the Spine,
-- method Generated() returns the start shape, that can
-- also be obtained by method FirstShape().
-- If S is a Profile closest to the end of the Spine, method
-- Generated() returns the end shape, that can also be
-- obtained by method LastShape().
---C++: return const &
returns ListOfShape from TopTools
is redefined;
ErrorOnSurface (me)
returns Real from Standard;
fields
myPipe : PipeShell from BRepFill;
end MakePipeShell;

View File

@@ -14,11 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakePipeShell.ixx>
#include <BRepFill_PipeShell.hxx>
#include <BRepOffsetAPI_MakePipeShell.hxx>
#include <GeomFill_PipeError.hxx>
#include <gp_Ax2.hxx>
#include <gp_Dir.hxx>
#include <Law_Function.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
//=======================================================================
//function :

View File

@@ -0,0 +1,312 @@
// Created on: 1998-04-08
// Created by: Philippe MANGIN
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-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_MakePipeShell_HeaderFile
#define _BRepOffsetAPI_MakePipeShell_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepPrimAPI_MakeSweep.hxx>
#include <Standard_Boolean.hxx>
#include <BRepFill_TypeOfContact.hxx>
#include <BRepBuilderAPI_PipeError.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <BRepBuilderAPI_TransitionMode.hxx>
#include <TopTools_ListOfShape.hxx>
class BRepFill_PipeShell;
class Standard_DomainError;
class StdFail_NotDone;
class TopoDS_Wire;
class gp_Ax2;
class gp_Dir;
class TopoDS_Shape;
class TopoDS_Vertex;
class Law_Function;
//! This class provides for a framework to construct a shell
//! or a solid along a spine consisting in a wire.
//! To produce a solid, the initial wire must be closed.
//! Two approaches are used:
//! - definition by section
//! - by a section and a scaling law
//! - by addition of successive intermediary sections
//! - definition by sweep mode.
//! - pseudo-Frenet
//! - constant
//! - binormal constant
//! - normal defined by a surface support
//! - normal defined by a guiding contour.
//! The two global approaches can also be combined.
//! You can also close the surface later in order to form a solid.
//! Warning: In this version some limitation exist
//! -- We can add only 1 Section (else Standard_NotImplemented is raised
//! -- Mode with auxilary spine is incompatible with hometetic laws
//! -- Mode with auxilary spine and keep contact produce only CO surface.
//! -- Transition treatement is implemented only with the option <BRepBuilderAPI_Transformed>
//! Normaly all these limitations have to be deleted in mext version.
class BRepOffsetAPI_MakePipeShell : public BRepPrimAPI_MakeSweep
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs the shell-generating framework defined by the wire Spine.
//! Sets an sweep's mode
//! If no mode are setted, the mode use in MakePipe is used
Standard_EXPORT BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spine);
//! Sets a Frenet or a CorrectedFrenet trihedron
//! to perform the sweeping
//! If IsFrenet is false, a corrected Frenet trihedron is used.
Standard_EXPORT void SetMode (const Standard_Boolean IsFrenet = Standard_False);
//! Sets a Discrete trihedron
//! to perform the sweeping
Standard_EXPORT void SetDiscreteMode();
//! Sets a fixed trihedron to perform the sweeping
//! all sections will be parallel.
Standard_EXPORT void SetMode (const gp_Ax2& Axe);
//! Sets a fixed BiNormal direction to perform the --
//! sweeping. Angular relations beetween the
//! section(s) and <BiNormal> will be constant
Standard_EXPORT void SetMode (const gp_Dir& BiNormal);
//! Sets support to the spine to define the BiNormal of
//! the trihedron, like the normal to the surfaces.
//! Warning: To be effective, Each edge of the <spine> must
//! have an representaion on one face of<SpineSupport>
Standard_EXPORT Standard_Boolean SetMode (const TopoDS_Shape& SpineSupport);
//! Sets an auxiliary spine to define the Normal
//! For each Point of the Spine P, an Point Q is evalued
//! on <AuxiliarySpine>
//! If <CurvilinearEquivalence>
//! Q split <AuxiliarySpine> with the same length ratio
//! than P split <Spline>.
//! Else the plan define by P and the tangent to the <Spine>
//! intersect <AuxiliarySpine> in Q.
//! If <KeepContact> equals BRepFill_NoContact: The Normal is defined
//! by the vector PQ.
//! If <KeepContact> equals BRepFill_Contact: The Normal is defined to
//! achieve that the sweeped section is in contact to the
//! auxiliarySpine. The width of section is constant all along the path.
//! In other words, the auxiliary spine lies on the swept surface,
//! but not necessarily is a boundary of this surface. However,
//! the auxiliary spine has to be close enough to the main spine
//! to provide intersection with any section all along the path.
//! If <KeepContact> equals BRepFill_ContactOnBorder: The auxiliary spine
//! becomes a boundary of the swept surface and the width of section varies
//! along the path.
//! Give section to sweep.
//! Possibilities are :
//! - Give one or sevral section
//! - Give one profile and an homotetic law.
//! - Automatic compute of correspondance beetween spine, and section
//! on the sweeped shape
//! - correspondance beetween spine, and section on the sweeped shape
//! defined by a vertex of the spine
Standard_EXPORT void SetMode (const TopoDS_Wire& AuxiliarySpine, const Standard_Boolean CurvilinearEquivalence, const BRepFill_TypeOfContact KeepContact = BRepFill_NoContact);
//! Adds the section Profile to this framework. First and last
//! sections may be punctual, so the shape Profile may be
//! both wire and vertex. Correspondent point on spine is
//! computed automatically.
//! If WithContact is true, the section is translated to be in
//! contact with the spine.
//! If WithCorrection is true, the section is rotated to be
//! orthogonal to the spine?s tangent in the correspondent
//! point. This option has no sense if the section is punctual
//! (Profile is of type TopoDS_Vertex).
Standard_EXPORT void Add (const TopoDS_Shape& Profile, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
//! Adds the section Profile to this framework.
//! Correspondent point on the spine is given by Location.
//! Warning:
//! To be effective, it is not recommended to combine methods Add and SetLaw.
Standard_EXPORT void Add (const TopoDS_Shape& Profile, const TopoDS_Vertex& Location, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
//! Sets the evolution law defined by the wire Profile with
//! its position (Location, WithContact, WithCorrection
//! are the same options as in methods Add) and a
//! homotetic law defined by the function L.
//! Warning:
//! To be effective, it is not recommended to combine methods Add and SetLaw.
Standard_EXPORT void SetLaw (const TopoDS_Shape& Profile, const Handle(Law_Function)& L, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
//! Sets the evolution law defined by the wire Profile with
//! its position (Location, WithContact, WithCorrection
//! are the same options as in methods Add) and a
//! homotetic law defined by the function L.
//! Warning:
//! To be effective, it is not recommended to combine methods Add and SetLaw.
Standard_EXPORT void SetLaw (const TopoDS_Shape& Profile, const Handle(Law_Function)& L, const TopoDS_Vertex& Location, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
//! Removes the section Profile from this framework.
Standard_EXPORT void Delete (const TopoDS_Shape& Profile);
//! Returns true if this tool object is ready to build the
//! shape, i.e. has a definition for the wire section Profile.
Standard_EXPORT Standard_Boolean IsReady() const;
//! Get a status, when Simulate or Build failed. It can be
//! BRepBuilderAPI_PipeDone,
//! BRepBuilderAPI_PipeNotDone,
//! BRepBuilderAPI_PlaneNotIntersectGuide,
//! BRepBuilderAPI_ImpossibleContact.
Standard_EXPORT BRepBuilderAPI_PipeError GetStatus() const;
//! Sets the following tolerance values
//! - 3D tolerance Tol3d
//! - boundary tolerance BoundTol
//! - angular tolerance TolAngular.
Standard_EXPORT void SetTolerance (const Standard_Real Tol3d = 1.0e-4, const Standard_Real BoundTol = 1.0e-4, const Standard_Real TolAngular = 1.0e-2);
//! Define the maximum V degree of resulting surface
Standard_EXPORT void SetMaxDegree (const Standard_Integer NewMaxDegree);
//! Define the maximum number of spans in V-direction
//! on resulting surface
Standard_EXPORT void SetMaxSegments (const Standard_Integer NewMaxSegments);
//! Set the flag that indicates attempt to approximate
//! a C1-continuous surface if a swept surface proved
//! to be C0.
Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
//! Sets the transition mode to manage discontinuities on
//! the swept shape caused by fractures on the spine. The
//! transition mode can be BRepBuilderAPI_Transformed
//! (default value), BRepBuilderAPI_RightCorner,
//! BRepBuilderAPI_RoundCorner:
//! - RepBuilderAPI_Transformed:
//! discontinuities are treated by
//! modification of the sweeping mode. The
//! pipe is "transformed" at the fractures of
//! the spine. This mode assumes building a
//! self-intersected shell.
//! - BRepBuilderAPI_RightCorner:
//! discontinuities are treated like right
//! corner. Two pieces of the pipe
//! corresponding to two adjacent
//! segments of the spine are extended
//! and intersected at a fracture of the spine.
//! - BRepBuilderAPI_RoundCorner:
//! discontinuities are treated like round
//! corner. The corner is treated as rotation
//! of the profile around an axis which
//! passes through the point of the spine?s
//! fracture. This axis is based on cross
//! product of directions tangent to the
//! adjacent segments of the spine at their common point.
//! Warnings
//! The mode BRepBuilderAPI_RightCorner provides a
//! valid result if intersection of two pieces of the pipe
//! (corresponding to two adjacent segments of the spine)
//! in the neighborhood of the spine?s fracture is
//! connected and planar. This condition can be violated if
//! the spine is non-linear in some neighborhood of the
//! fracture or if the profile was set with a scaling law.
//! The last mode, BRepBuilderAPI_RoundCorner, will
//! assuredly provide a good result only if a profile was set
//! with option WithCorrection = True, i.e. it is strictly
//! orthogonal to the spine.
Standard_EXPORT void SetTransitionMode (const BRepBuilderAPI_TransitionMode Mode = BRepBuilderAPI_Transformed);
//! Simulates the resulting shape by calculating its
//! cross-sections. The spine is devided by this
//! cross-sections into (NumberOfSection - 1) equal
//! parts, the number of cross-sections is
//! NumberOfSection. The cross-sections are wires and
//! they are returned in the list Result.
//! This gives a rapid preview of the resulting shape,
//! which will be obtained using the settings you have provided.
//! Raises NotDone if <me> it is not Ready
Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Result);
//! Builds the resulting shape (redefined from MakeShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Transforms the sweeping Shell in Solid.
//! If a propfile is not closed returns False
Standard_EXPORT Standard_Boolean MakeSolid();
//! Returns the TopoDS Shape of the bottom of the sweep.
Standard_EXPORT virtual TopoDS_Shape FirstShape() Standard_OVERRIDE;
//! Returns the TopoDS Shape of the top of the sweep.
Standard_EXPORT virtual TopoDS_Shape LastShape() Standard_OVERRIDE;
//! Returns a list of new shapes generated from the shape
//! S by the shell-generating algorithm.
//! This function is redefined from BRepOffsetAPI_MakeShape::Generated.
//! S can be an edge of the given Spine (see Constructor),
//! it can be an edge or a boundary vertex of a shape
//! returned by the method FirstShape(), it can also be a
//! Profile (see method Add()) closest to the beginning or
//! the end of the Spine.
//! If S is an edge of the given Spine, then method
//! Generated() returns a list of generated faces and a list
//! of edges from a free boundary (if it exists) of the
//! resulting shell.
//! If S is an edge of the start shape (see FirstShape()),
//! method Generated() returns a list of faces generated
//! along the whole spine from the given edge.
//! If S is a boundary vertex of the start shape (see
//! FirstShape()), method Generated() returns a list of
//! edges from the free boundary of the resulting shell,
//! generated along the whole spine.
//! If S is a Profile closest to the beginning of the Spine,
//! method Generated() returns the start shape, that can
//! also be obtained by method FirstShape().
//! If S is a Profile closest to the end of the Spine, method
//! Generated() returns the end shape, that can also be
//! obtained by method LastShape().
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
Standard_EXPORT Standard_Real ErrorOnSurface() const;
protected:
private:
Handle(BRepFill_PipeShell) myPipe;
};
#endif // _BRepOffsetAPI_MakePipeShell_HeaderFile

View File

@@ -1,112 +0,0 @@
-- Created on: 1996-02-13
-- Created by: Yves FRICAUD
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-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.
class MakeThickSolid from BRepOffsetAPI inherits MakeOffsetShape from BRepOffsetAPI
---Purpose: Describes functions to build hollowed solids.
-- A hollowed solid is built from an initial solid and a set of
-- faces on this solid, which are to be removed. The
-- remaining faces of the solid become the walls of the
-- hollowed solid, their thickness defined at the time of construction.
-- the solid is built from an initial
-- solid <S> and a set of faces {Fi} from <S>,
-- builds a solid composed by two shells closed by
-- the {Fi}. First shell <SS> is composed by all
-- the faces of <S> expected {Fi}. Second shell is
-- the offset shell of <SS>.
-- A MakeThickSolid object provides a framework for:
-- - defining the cross-section of a hollowed solid,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses
MakeOffset from BRepOffset,
Mode from BRepOffset,
Shape from TopoDS,
Face from TopoDS,
ListOfShape from TopTools,
JoinType from GeomAbs
is
Create returns MakeThickSolid from BRepOffsetAPI;
Create ( S : Shape from TopoDS;
ClosingFaces : ListOfShape from TopTools;
Offset : Real from Standard;
Tol : Real from Standard ;
Mode : Mode from BRepOffset = BRepOffset_Skin;
Intersection : Boolean from Standard = Standard_False;
SelfInter : Boolean from Standard = Standard_False;
Join : JoinType from GeomAbs = GeomAbs_Arc)
---Purpose: Constructs a hollowed solid from
-- the solid S by removing the set of faces ClosingFaces from S, where:
-- Offset defines the thickness of the walls. Its sign indicates
-- which side of the surface of the solid the hollowed shape is built on;
-- - Tol defines the tolerance criterion for coincidence in generated shapes;
-- - Mode defines the construction type of parallels applied to free
-- edges of shape S. Currently, only one construction type is
-- implemented, namely the one where the free edges do not generate
-- parallels; this corresponds to the default value BRepOffset_Skin;
-- Intersection specifies how the algorithm must work in order to
-- limit the parallels to two adjacent shapes:
-- - if Intersection is false (default value), the intersection
-- is calculated with the parallels to the two adjacent shapes,
-- - if Intersection is true, the intersection is calculated by
-- taking account of all parallels generated; this computation
-- method is more general as it avoids self-intersections
-- generated in the offset shape from features of small dimensions
-- on shape S, however this method has not been completely
-- implemented and therefore is not recommended for use;
-- - SelfInter tells the algorithm whether a computation to
-- eliminate self-intersections needs to be applied to the
-- resulting shape. However, as this functionality is not yet
-- implemented, you should use the default value (false);
-- - Join defines how to fill the holes that may appear between
-- parallels to the two adjacent faces. It may take values
-- GeomAbs_Arc or GeomAbs_Intersection:
-- - if Join is equal to GeomAbs_Arc, then pipes are generated
-- between two free edges of two adjacent parallels,
-- and spheres are generated on "images" of vertices;
-- it is the default value,
-- - if Join is equal to GeomAbs_Intersection,
-- then the parallels to the two adjacent faces are
-- enlarged and intersected, so that there are no free
-- edges on parallels to faces.
-- Warnings
-- Since the algorithm of MakeThickSolid is based on
-- MakeOffsetShape algorithm, the warnings are the same as for
-- MakeOffsetShape.
returns MakeThickSolid from BRepOffsetAPI;
Build (me : in out)
is redefined;
---Purpose: Builds the resulting shape (redefined from MakeOffsetShape).
---Level: Public
Modified (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes modified from the shape
-- <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
end MakeThickSolid;

View File

@@ -14,18 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MakeThickSolid.ixx>
#include <BRepOffset_MakeOffset.hxx>
#include <Standard_ConstructionError.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>
#include <BRepOffset_MakeOffset.hxx>
#include <BRepOffsetAPI_MakeThickSolid.hxx>
#include <Standard_ConstructionError.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//=======================================================================
//function : BRepOffsetAPI_MakeThickSolid
//purpose :
//=======================================================================
BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid()
{
}

View File

@@ -0,0 +1,127 @@
// Created on: 1996-02-13
// Created by: Yves FRICAUD
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-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_MakeThickSolid_HeaderFile
#define _BRepOffsetAPI_MakeThickSolid_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepOffsetAPI_MakeOffsetShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <Standard_Real.hxx>
#include <BRepOffset_Mode.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_JoinType.hxx>
class TopoDS_Shape;
//! Describes functions to build hollowed solids.
//! A hollowed solid is built from an initial solid and a set of
//! faces on this solid, which are to be removed. The
//! remaining faces of the solid become the walls of the
//! hollowed solid, their thickness defined at the time of construction.
//! the solid is built from an initial
//! solid <S> and a set of faces {Fi} from <S>,
//! builds a solid composed by two shells closed by
//! the {Fi}. First shell <SS> is composed by all
//! the faces of <S> expected {Fi}. Second shell is
//! the offset shell of <SS>.
//! A MakeThickSolid object provides a framework for:
//! - defining the cross-section of a hollowed solid,
//! - implementing the construction algorithm, and
//! - consulting the result.
class BRepOffsetAPI_MakeThickSolid : public BRepOffsetAPI_MakeOffsetShape
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepOffsetAPI_MakeThickSolid();
//! Constructs a hollowed solid from
//! the solid S by removing the set of faces ClosingFaces from S, where:
//! Offset defines the thickness of the walls. Its sign indicates
//! which side of the surface of the solid the hollowed shape is built on;
//! - Tol defines the tolerance criterion for coincidence in generated shapes;
//! - Mode defines the construction type of parallels applied to free
//! edges of shape S. Currently, only one construction type is
//! implemented, namely the one where the free edges do not generate
//! parallels; this corresponds to the default value BRepOffset_Skin;
//! Intersection specifies how the algorithm must work in order to
//! limit the parallels to two adjacent shapes:
//! - if Intersection is false (default value), the intersection
//! is calculated with the parallels to the two adjacent shapes,
//! - if Intersection is true, the intersection is calculated by
//! taking account of all parallels generated; this computation
//! method is more general as it avoids self-intersections
//! generated in the offset shape from features of small dimensions
//! on shape S, however this method has not been completely
//! implemented and therefore is not recommended for use;
//! - SelfInter tells the algorithm whether a computation to
//! eliminate self-intersections needs to be applied to the
//! resulting shape. However, as this functionality is not yet
//! implemented, you should use the default value (false);
//! - Join defines how to fill the holes that may appear between
//! parallels to the two adjacent faces. It may take values
//! GeomAbs_Arc or GeomAbs_Intersection:
//! - if Join is equal to GeomAbs_Arc, then pipes are generated
//! between two free edges of two adjacent parallels,
//! and spheres are generated on "images" of vertices;
//! it is the default value,
//! - if Join is equal to GeomAbs_Intersection,
//! then the parallels to the two adjacent faces are
//! enlarged and intersected, so that there are no free
//! edges on parallels to faces.
//! Warnings
//! Since the algorithm of MakeThickSolid is based on
//! MakeOffsetShape algorithm, the warnings are the same as for
//! MakeOffsetShape.
Standard_EXPORT BRepOffsetAPI_MakeThickSolid(const TopoDS_Shape& S, const TopTools_ListOfShape& ClosingFaces, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc);
//! Builds the resulting shape (redefined from MakeOffsetShape).
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
};
#endif // _BRepOffsetAPI_MakeThickSolid_HeaderFile

View File

@@ -1,63 +0,0 @@
-- 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.
class MiddlePath from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build a middle path of a
-- pipe-like shape
uses
Shape from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Face from TopoDS,
MapOfShape from TopTools,
SequenceOfSequenceOfShape from BRepOffsetAPI
is
--Create(aShape : Shape from TopoDS;
-- StartWire : Wire from TopoDS)
--returns MiddlePath from BRepOffsetAPI;
--Create(aShape : Shape from TopoDS;
-- StartEdge : Edge from TopoDS)
--returns MiddlePath from BRepOffsetAPI;
Create(aShape : Shape from TopoDS;
StartShape : Shape from TopoDS;
EndShape : Shape from TopoDS)
---Purpose: General constructor.
-- StartShape and EndShape may be
-- a wire or a face
returns MiddlePath from BRepOffsetAPI;
Build(me: in out)
is redefined;
fields
myInitialShape : Shape from TopoDS;
myStartWire : Wire from TopoDS;
myEndWire : Wire from TopoDS;
myClosedSection : Boolean from Standard;
myClosedRing : Boolean from Standard;
myStartWireEdges : MapOfShape from TopTools;
myEndWireEdges : MapOfShape from TopTools;
myPaths : SequenceOfSequenceOfShape from BRepOffsetAPI;
end MiddlePath;

View File

@@ -13,56 +13,53 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_MiddlePath.ixx>
#include <BRepOffsetAPI_MiddlePath.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <gp_Lin.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Line.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <BRep_Tool.hxx>
#include <gce_MakeLin.hxx>
#include <BRepLib_MakeWire.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopExp.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>
#include <BRepTools.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepGProp.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepOffsetAPI_MiddlePath.hxx>
#include <BRepTools.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <GC_MakeCircle.hxx>
#include <GCE2d_MakeLine.hxx>
#include <gce_MakeLin.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <GCE2d_MakeLine.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib.hxx>
#include <GeomAbs_CurveType.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <BRepLib_MakeFace.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_Circle.hxx>
#include <gp_Circ.hxx>
#include <GC_MakeCircle.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <GeomLib.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <GeomLib.hxx>
#include <gp_Circ.hxx>
#include <gp_Lin.hxx>
#include <GProp_GProps.hxx>
#include <Precision.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
static Standard_Boolean IsLinear(const TopoDS_Edge& anEdge,
gp_Lin& aLine)

View File

@@ -0,0 +1,79 @@
// 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_MiddlePath_HeaderFile
#define _BRepOffsetAPI_MiddlePath_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_MapOfShape.hxx>
#include <BRepOffsetAPI_SequenceOfSequenceOfShape.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
class TopoDS_Shape;
//! Describes functions to build a middle path of a
//! pipe-like shape
class BRepOffsetAPI_MiddlePath : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! General constructor.
//! StartShape and EndShape may be
//! a wire or a face
Standard_EXPORT BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape, const TopoDS_Shape& StartShape, const TopoDS_Shape& EndShape);
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
protected:
private:
TopoDS_Shape myInitialShape;
TopoDS_Wire myStartWire;
TopoDS_Wire myEndWire;
Standard_Boolean myClosedSection;
Standard_Boolean myClosedRing;
TopTools_MapOfShape myStartWireEdges;
TopTools_MapOfShape myEndWireEdges;
BRepOffsetAPI_SequenceOfSequenceOfShape myPaths;
};
#endif // _BRepOffsetAPI_MiddlePath_HeaderFile

View File

@@ -1,169 +0,0 @@
-- Created on: 1997-10-13
-- Created by: Roman BORISOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-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.
class NormalProjection from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: A framework to define projection onto a shape
-- according to the normal from each point to be projected.
-- The target shape is a face, and the source shape is an edge or a wire.
-- The target face is considered to be a 2D surface.
uses Shape from TopoDS,
Edge from TopoDS,
Shape from GeomAbs,
NormalProjection from BRepAlgo,
ListOfShape from TopTools
raises ConstructionError from Standard,
NoSuchObject from Standard,
NotDone from StdFail
is
Create
---Purpose: Constructs an empty framework to define projection on
-- a shape according to the normal from each point to be
-- projected to the shape.
returns NormalProjection;
Create(S: Shape from TopoDS)
returns NormalProjection;
---Purpose: Constructs a framework to define projection onto the
-- basis shape S according to the normal from each point
-- to be projected from the shape added to this framework by Add.
-- Default parameters of the algorithm: Tol3D = 1.e-04, Tol2D =sqr(tol3d)
-- , InternalContinuity = GeomAbs_C2, MaxDegree = 14, MaxSeg = 16.
Init(me: in out; S: Shape from TopoDS)
---Purpose: Initializes the empty constructor framework with the shape S.
is static;
Add(me: in out; ToProj: Shape from TopoDS)
---Purpose: Adds the shape ToProj to the framework for calculation
-- of the projection by Compute3d.
-- ToProj is an edge or a wire and will be projected onto the basis shape.
-- Exceptions
-- Standard_ConstructionError if ToProj is not added.
raises ConstructionError from Standard
is static;
SetParams(me : in out; Tol3D, Tol2D : Real from Standard;
InternalContinuity : Shape from GeomAbs;
MaxDegree , MaxSeg : Integer from Standard)
---Purpose: Sets the parameters used for computation
-- Tol3 is the requiered tolerance between the 3d projected
-- curve and its 2d representation
-- InternalContinuity is the order of constraints
-- used for approximation
-- MaxDeg and MaxSeg are the maximum degree and the maximum
-- number of segment for BSpline resulting of an approximation.
is static;
SetMaxDistance(me: in out; MaxDist: Real from Standard)
---Purpose: Sets the maximum distance between target shape and
-- shape to project. If this condition is not satisfied then corresponding
-- part of solution is discarded.
-- if MaxDist < 0 then this method does not affect the algorithm
is static;
SetLimit(me : in out; FaceBoundaries: Boolean from Standard = Standard_True)
---Purpose: Manage limitation of projected edges.
--By default edges are limited by face boundaries,
--else they are limited by supporting surface boundaries.
is static;
Compute3d(me: in out; With3d: Boolean from Standard = Standard_True)
---Purpose: Returns true if a 3D curve is computed. If not, false is
-- returned and an initial 3D curve is kept to build the resulting edges.
is static;
Build(me: in out)
is redefined;
---Purpose: Builds the result of the projection as a compound of
-- wires. Tries to build oriented wires.
IsDone(me)
---Purpose:
returns Boolean from Standard
is redefined static;
---Purpose: Returns true if the object was correctly built by the shape
-- construction algorithm.
-- If at the construction time of the shape, the algorithm
-- cannot be completed, or the original data is corrupted,
-- IsDone returns false and therefore protects the use of
-- functions to access the result of the construction
-- (typically the Shape function).
Projection(me)
---Purpose: Performs the projection.
-- The construction of the result is performed by Build.
-- Exceptions
-- StdFail_NotDone if the projection was not performed.
returns Shape from TopoDS
---C++: return const&
raises NotDone from StdFail
is static;
Couple(me; E: Edge from TopoDS)
---Purpose: Returns the initial face corresponding to the projected edge E.
-- Exceptions
-- StdFail_NotDone if no face was found.
-- Standard_NoSuchObject if if a face corresponding to
-- E has already been found.
returns Shape from TopoDS
---C++: return const&
raises NotDone from StdFail,
NoSuchObject from Standard
is static;
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined;
Ancestor(me; E: Edge from TopoDS)
---Purpose: Returns the initial edge corresponding to the edge E
-- resulting from the computation of the projection.
-- Exceptions
-- StdFail_NotDone if no edge was found.
-- Standard_NoSuchObject if an edge corresponding to
-- E has already been found.
returns Shape from TopoDS
---C++: return const&
raises NotDone from StdFail,
NoSuchObject from Standard
is static;
BuildWire(me; Liste : out ListOfShape from TopTools)
returns Boolean from Standard
is static;
--- Purpose : build the result as a list of wire if possible in --
-- a first returns a wire only if there is only a wire.
fields
myNormalProjector : NormalProjection from BRepAlgo;
end NormalProjection;

View File

@@ -14,7 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_NormalProjection.ixx>
#include <BRepOffsetAPI_NormalProjection.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection()
{

View File

@@ -0,0 +1,159 @@
// Created on: 1997-10-13
// Created by: Roman BORISOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-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_NormalProjection_HeaderFile
#define _BRepOffsetAPI_NormalProjection_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepAlgo_NormalProjection.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
class Standard_ConstructionError;
class Standard_NoSuchObject;
class StdFail_NotDone;
class TopoDS_Shape;
class TopoDS_Edge;
//! A framework to define projection onto a shape
//! according to the normal from each point to be projected.
//! The target shape is a face, and the source shape is an edge or a wire.
//! The target face is considered to be a 2D surface.
class BRepOffsetAPI_NormalProjection : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty framework to define projection on
//! a shape according to the normal from each point to be
//! projected to the shape.
Standard_EXPORT BRepOffsetAPI_NormalProjection();
//! Constructs a framework to define projection onto the
//! basis shape S according to the normal from each point
//! to be projected from the shape added to this framework by Add.
//! Default parameters of the algorithm: Tol3D = 1.e-04, Tol2D =sqr(tol3d)
//! , InternalContinuity = GeomAbs_C2, MaxDegree = 14, MaxSeg = 16.
Standard_EXPORT BRepOffsetAPI_NormalProjection(const TopoDS_Shape& S);
//! Initializes the empty constructor framework with the shape S.
Standard_EXPORT void Init (const TopoDS_Shape& S);
//! Adds the shape ToProj to the framework for calculation
//! of the projection by Compute3d.
//! ToProj is an edge or a wire and will be projected onto the basis shape.
//! Exceptions
//! Standard_ConstructionError if ToProj is not added.
Standard_EXPORT void Add (const TopoDS_Shape& ToProj);
//! Sets the parameters used for computation
//! Tol3 is the requiered tolerance between the 3d projected
//! curve and its 2d representation
//! InternalContinuity is the order of constraints
//! used for approximation
//! MaxDeg and MaxSeg are the maximum degree and the maximum
//! number of segment for BSpline resulting of an approximation.
Standard_EXPORT void SetParams (const Standard_Real Tol3D, const Standard_Real Tol2D, const GeomAbs_Shape InternalContinuity, const Standard_Integer MaxDegree, const Standard_Integer MaxSeg);
//! Sets the maximum distance between target shape and
//! shape to project. If this condition is not satisfied then corresponding
//! part of solution is discarded.
//! if MaxDist < 0 then this method does not affect the algorithm
Standard_EXPORT void SetMaxDistance (const Standard_Real MaxDist);
//! Manage limitation of projected edges.
Standard_EXPORT void SetLimit (const Standard_Boolean FaceBoundaries = Standard_True);
//! Returns true if a 3D curve is computed. If not, false is
//! returned and an initial 3D curve is kept to build the resulting edges.
Standard_EXPORT void Compute3d (const Standard_Boolean With3d = Standard_True);
//! Builds the result of the projection as a compound of
//! wires. Tries to build oriented wires.
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns true if the object was correctly built by the shape
//! construction algorithm.
//! If at the construction time of the shape, the algorithm
//! cannot be completed, or the original data is corrupted,
//! IsDone returns false and therefore protects the use of
//! functions to access the result of the construction
//! (typically the Shape function).
Standard_EXPORT Standard_Boolean IsDone() const Standard_OVERRIDE;
//! Performs the projection.
//! The construction of the result is performed by Build.
//! Exceptions
//! StdFail_NotDone if the projection was not performed.
Standard_EXPORT const TopoDS_Shape& Projection() const;
//! Returns the initial face corresponding to the projected edge E.
//! Exceptions
//! StdFail_NotDone if no face was found.
//! Standard_NoSuchObject if if a face corresponding to
//! E has already been found.
Standard_EXPORT const TopoDS_Shape& Couple (const TopoDS_Edge& E) const;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the initial edge corresponding to the edge E
//! resulting from the computation of the projection.
//! Exceptions
//! StdFail_NotDone if no edge was found.
//! Standard_NoSuchObject if an edge corresponding to
//! E has already been found.
Standard_EXPORT const TopoDS_Shape& Ancestor (const TopoDS_Edge& E) const;
//! build the result as a list of wire if possible in --
//! a first returns a wire only if there is only a wire.
Standard_EXPORT Standard_Boolean BuildWire (TopTools_ListOfShape& Liste) const;
protected:
private:
BRepAlgo_NormalProjection myNormalProjector;
};
#endif // _BRepOffsetAPI_NormalProjection_HeaderFile

View File

@@ -0,0 +1,25 @@
// Created on: 1999-10-11
// Created by: Atelier CAS2000
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-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_Sewing_HeaderFile
#define _BRepOffsetAPI_Sewing_HeaderFile
#include <BRepBuilderAPI_Sewing.hxx>
typedef BRepBuilderAPI_Sewing BRepOffsetAPI_Sewing;
typedef Handle_BRepBuilderAPI_Sewing Handle_BRepOffsetAPI_Sewing;
#endif // _BRepOffsetAPI_Sewing_HeaderFile

View File

@@ -1,213 +0,0 @@
-- Created on: 1995-07-17
-- Created by: Jing-Cheng MEI
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-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.
-- Modified: Mon Jan 12 10:46:37 1998
-- new method ArrangeWires
-- Modified: Mon Jan 19 10:11:49 1998
-- new methods CreateKPart and DetectKPart
-- Modified: Mon Feb 23 09:28:33 1998
-- modification of ArrangeWires
-- for sections with different number of elements
-- Modified: Mon Apr 6 16:24:40 1998
-- CreateKPart and DetectKPart moved in BRepFill
-- Modified: Wed Jul 1 14:33:22 1998
-- Add history
-- CreateKPart and DetectKPart moved in BRepFill
class ThruSections from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build a loft. This is a shell or a
-- solid passing through a set of sections in a given
-- sequence. Usually sections are wires, but the first and
-- the last sections may be vertices (punctual sections).
uses
Wire from TopoDS,
Vertex from TopoDS,
SequenceOfShape from TopTools,
Face from TopoDS,
Shape from TopoDS,
DataMapOfShapeShape from TopTools,
Array1OfShape from TopTools,
BSplineSurface from Geom,
--
Shape from GeomAbs,
ParametrizationType from Approx
raises DomainError from Standard
is
Create(isSolid : Boolean from Standard = Standard_False;
ruled : Boolean from Standard = Standard_False;
pres3d : Real =1.0e-06)
returns ThruSections from BRepOffsetAPI;
---Purpose: Initializes an algorithm for building a shell or a solid
-- passing through a set of sections, where:
-- - isSolid is set to true if the construction algorithm is
-- required to build a solid or to false if it is required to build
-- a shell (the default value),
-- - ruled is set to true if the faces generated between
-- the edges of two consecutive wires are ruled surfaces or to
-- false (the default value) if they are smoothed out by approximation,
-- - pres3d defines the precision criterion used by the
-- approximation algorithm; the default value is 1.0e-6.
-- Use AddWire and AddVertex to define the
-- successive sections of the shell or solid to be built.
Init(me: in out; isSolid : Boolean from Standard = Standard_False;
ruled : Boolean from Standard = Standard_False;
pres3d : Real =1.0e-06);
---Purpose: Initializes this algorithm for building a shell or a solid
-- passing through a set of sections, where:
-- - isSolid is set to true if this construction algorithm is
-- required to build a solid or to false if it is required to
-- build a shell. false is the default value;
-- - ruled is set to true if the faces generated between the
-- edges of two consecutive wires are ruled surfaces or
-- to false (the default value) if they are smoothed out by approximation,
-- - pres3d defines the precision criterion used by the
-- approximation algorithm; the default value is 1.0e-6.
-- Use AddWire and AddVertex to define the successive
-- sections of the shell or solid to be built.
AddWire(me: in out; wire: Wire from TopoDS);
---Purpose: Adds the wire wire to the set of
-- sections through which the shell or solid is built.
-- Use the Build function to construct the shape.
AddVertex(me: in out; aVertex: Vertex from TopoDS);
---Purpose: Adds the vertex Vertex (punctual section) to the set of sections
-- through which the shell or solid is built. A vertex may be added to the
-- set of sections only as first or last section. At least one wire
-- must be added to the set of sections by the method AddWire.
-- Use the Build function to construct the shape.
CheckCompatibility(me: in out;
check : Boolean from Standard = Standard_True);
---Purpose: Sets/unsets the option to
-- compute origin and orientation on wires to avoid twisted results
-- and update wires to have same number of edges.
SetSmoothing(me: in out; UseSmoothing : Boolean from Standard)
---Purpose: Define the approximation algorithm
is static;
SetParType(me: in out; ParType : ParametrizationType from Approx)
---Purpose: Define the type of parametrization used in the approximation
is static;
SetContinuity(me: in out; C : Shape from GeomAbs)
---Purpose: Define the Continuity used in the approximation
is static;
SetCriteriumWeight(me : in out;
W1, W2, W3 : Real)
---Purpose: define the Weights associed to the criterium used in
-- the optimization.
--
raises DomainError -- if Wi <= 0
is static;
SetMaxDegree(me : in out; MaxDeg : Integer from Standard)
---Purpose: Define the maximal U degree of result surface
is static;
ParType(me)
---Purpose: returns the type of parametrization used in the approximation
returns ParametrizationType from Approx
is static;
Continuity(me)
---Purpose: returns the Continuity used in the approximation
returns Shape from GeomAbs
is static;
MaxDegree(me)
---Purpose: returns the maximal U degree of result surface
returns Integer from Standard
is static;
UseSmoothing(me)
---Purpose: Define the approximation algorithm
returns Boolean from Standard
is static;
CriteriumWeight(me ; W1, W2, W3 : out Real)
---Purpose: returns the Weights associed to the criterium used in
-- the optimization.
is static;
Build(me: in out)
is redefined;
CreateRuled(me: in out)
is private;
CreateSmoothed(me: in out)
is private;
FirstShape (me)
---Purpose: Returns the TopoDS Shape of the bottom of the loft if solid
returns Shape from TopoDS;
---C++ : return const &
LastShape (me)
---Purpose: Returns the TopoDS Shape of the top of the loft if solid
returns Shape from TopoDS;
---C++ : return const &
GeneratedFace (me; Edge : Shape from TopoDS)
---Purpose: if Ruled
-- Returns the Face generated by each edge
-- except the last wire
-- if smoothed
-- Returns the Face generated by each edge of the first wire
returns Shape from TopoDS;
TotalSurf(me; shapes: Array1OfShape from TopTools;
NbSect: Integer from Standard;
NbEdges: Integer from Standard;
w1Point: Boolean from Standard;
w2Point: Boolean from Standard;
vClosed: Boolean from Standard)
returns BSplineSurface from Geom
is private;
fields
myWires : SequenceOfShape from TopTools;
myIsSolid : Boolean from Standard;
myIsRuled : Boolean from Standard;
myWCheck : Boolean from Standard;
myPres3d : Real from Standard;
myFirst : Face from TopoDS;
myLast : Face from TopoDS;
myGenerated : DataMapOfShapeShape from TopTools;
-- Approximation parameters
myContinuity: Shape from GeomAbs;
myParamType : ParametrizationType from Approx;
myDegMax : Integer from Standard;
myCritWeights : Real[3];
myUseSmoothing : Boolean from Standard;
end ThruSections;

View File

@@ -42,70 +42,59 @@
// Modified: Tue Nov 3 10:06:15 1998
// utilisation de BRepFill_CompatibleWires
#include <BRepOffsetAPI_ThruSections.ixx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <GeomAbs_Shape.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_Conic.hxx>
#include <Geom2d_Line.hxx>
#include <GeomFill_Line.hxx>
#include <GeomFill_AppSurf.hxx>
#include <GeomFill_SectionGenerator.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomConvert.hxx>
#include <GeomConvert_ApproxCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <BSplCLib.hxx>
#include <TopAbs.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopExp.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BRepLib.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BRepFill_Generator.hxx>
#include <BRepFill_CompatibleWires.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_FindPlane.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BRepFill_CompatibleWires.hxx>
#include <BRepFill_Generator.hxx>
#include <BRepLib.hxx>
#include <BRepOffsetAPI_ThruSections.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BSplCLib.hxx>
#include <Geom2d_Line.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_Conic.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAbs_Shape.hxx>
#include <GeomConvert.hxx>
#include <GeomConvert_ApproxCurve.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomFill_AppSurf.hxx>
#include <GeomFill_Line.hxx>
#include <GeomFill_SectionGenerator.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NullObject.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//=======================================================================
//function : PreciseUpar
//purpose : pins the u-parameter of surface close to U-knot
// to this U-knot
//=======================================================================
static Standard_Real PreciseUpar(const Standard_Real anUpar,
const Handle(Geom_BSplineSurface)& aSurface)
{

View File

@@ -0,0 +1,188 @@
// Created on: 1995-07-17
// Created by: Jing-Cheng MEI
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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_ThruSections_HeaderFile
#define _BRepOffsetAPI_ThruSections_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <GeomAbs_Shape.hxx>
#include <Approx_ParametrizationType.hxx>
#include <Standard_Integer.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <TopTools_Array1OfShape.hxx>
class Standard_DomainError;
class TopoDS_Wire;
class TopoDS_Vertex;
class TopoDS_Shape;
class Geom_BSplineSurface;
//! Describes functions to build a loft. This is a shell or a
//! solid passing through a set of sections in a given
//! sequence. Usually sections are wires, but the first and
//! the last sections may be vertices (punctual sections).
class BRepOffsetAPI_ThruSections : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes an algorithm for building a shell or a solid
//! passing through a set of sections, where:
//! - isSolid is set to true if the construction algorithm is
//! required to build a solid or to false if it is required to build
//! a shell (the default value),
//! - ruled is set to true if the faces generated between
//! the edges of two consecutive wires are ruled surfaces or to
//! false (the default value) if they are smoothed out by approximation,
//! - pres3d defines the precision criterion used by the
//! approximation algorithm; the default value is 1.0e-6.
//! Use AddWire and AddVertex to define the
//! successive sections of the shell or solid to be built.
Standard_EXPORT BRepOffsetAPI_ThruSections(const Standard_Boolean isSolid = Standard_False, const Standard_Boolean ruled = Standard_False, const Standard_Real pres3d = 1.0e-06);
//! Initializes this algorithm for building a shell or a solid
//! passing through a set of sections, where:
//! - isSolid is set to true if this construction algorithm is
//! required to build a solid or to false if it is required to
//! build a shell. false is the default value;
//! - ruled is set to true if the faces generated between the
//! edges of two consecutive wires are ruled surfaces or
//! to false (the default value) if they are smoothed out by approximation,
//! - pres3d defines the precision criterion used by the
//! approximation algorithm; the default value is 1.0e-6.
//! Use AddWire and AddVertex to define the successive
//! sections of the shell or solid to be built.
Standard_EXPORT void Init (const Standard_Boolean isSolid = Standard_False, const Standard_Boolean ruled = Standard_False, const Standard_Real pres3d = 1.0e-06);
//! Adds the wire wire to the set of
//! sections through which the shell or solid is built.
//! Use the Build function to construct the shape.
Standard_EXPORT void AddWire (const TopoDS_Wire& wire);
//! Adds the vertex Vertex (punctual section) to the set of sections
//! through which the shell or solid is built. A vertex may be added to the
//! set of sections only as first or last section. At least one wire
//! must be added to the set of sections by the method AddWire.
//! Use the Build function to construct the shape.
Standard_EXPORT void AddVertex (const TopoDS_Vertex& aVertex);
//! Sets/unsets the option to
//! compute origin and orientation on wires to avoid twisted results
//! and update wires to have same number of edges.
Standard_EXPORT void CheckCompatibility (const Standard_Boolean check = Standard_True);
//! Define the approximation algorithm
Standard_EXPORT void SetSmoothing (const Standard_Boolean UseSmoothing);
//! Define the type of parametrization used in the approximation
Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType);
//! Define the Continuity used in the approximation
Standard_EXPORT void SetContinuity (const GeomAbs_Shape C);
//! define the Weights associed to the criterium used in
//! the optimization.
//!
//! if Wi <= 0
Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3);
//! Define the maximal U degree of result surface
Standard_EXPORT void SetMaxDegree (const Standard_Integer MaxDeg);
//! returns the type of parametrization used in the approximation
Standard_EXPORT Approx_ParametrizationType ParType() const;
//! returns the Continuity used in the approximation
Standard_EXPORT GeomAbs_Shape Continuity() const;
//! returns the maximal U degree of result surface
Standard_EXPORT Standard_Integer MaxDegree() const;
//! Define the approximation algorithm
Standard_EXPORT Standard_Boolean UseSmoothing() const;
//! returns the Weights associed to the criterium used in
//! the optimization.
Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const;
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! Returns the TopoDS Shape of the bottom of the loft if solid
Standard_EXPORT const TopoDS_Shape& FirstShape() const;
//! Returns the TopoDS Shape of the top of the loft if solid
Standard_EXPORT const TopoDS_Shape& LastShape() const;
//! if Ruled
//! Returns the Face generated by each edge
//! except the last wire
//! if smoothed
//! Returns the Face generated by each edge of the first wire
Standard_EXPORT TopoDS_Shape GeneratedFace (const TopoDS_Shape& Edge) const;
protected:
private:
Standard_EXPORT void CreateRuled();
Standard_EXPORT void CreateSmoothed();
Standard_EXPORT Handle(Geom_BSplineSurface) TotalSurf (const TopTools_Array1OfShape& shapes, const Standard_Integer NbSect, const Standard_Integer NbEdges, const Standard_Boolean w1Point, const Standard_Boolean w2Point, const Standard_Boolean vClosed) const;
TopTools_SequenceOfShape myWires;
Standard_Boolean myIsSolid;
Standard_Boolean myIsRuled;
Standard_Boolean myWCheck;
Standard_Real myPres3d;
TopoDS_Face myFirst;
TopoDS_Face myLast;
TopTools_DataMapOfShapeShape myGenerated;
GeomAbs_Shape myContinuity;
Approx_ParametrizationType myParamType;
Standard_Integer myDegMax;
Standard_Real myCritWeights[3];
Standard_Boolean myUseSmoothing;
};
#endif // _BRepOffsetAPI_ThruSections_HeaderFile

View File

@@ -1,2 +1,29 @@
BRepOffsetAPI_DraftAngle.cxx
BRepOffsetAPI_DraftAngle.hxx
BRepOffsetAPI_FindContigousEdges.cxx
BRepOffsetAPI_FindContigousEdges.hxx
BRepOffsetAPI_MakeDraft.cxx
BRepOffsetAPI_MakeDraft.hxx
BRepOffsetAPI_MakeEvolved.cxx
BRepOffsetAPI_MakeEvolved.hxx
BRepOffsetAPI_MakeFilling.cxx
BRepOffsetAPI_MakeFilling.hxx
BRepOffsetAPI_MakeOffset.cxx
BRepOffsetAPI_MakeOffset.hxx
BRepOffsetAPI_MakeOffsetShape.cxx
BRepOffsetAPI_MakeOffsetShape.hxx
BRepOffsetAPI_MakePipe.cxx
BRepOffsetAPI_MakePipe.hxx
BRepOffsetAPI_MakePipeShell.cxx
BRepOffsetAPI_MakePipeShell.hxx
BRepOffsetAPI_MakeThickSolid.cxx
BRepOffsetAPI_MakeThickSolid.hxx
BRepOffsetAPI_MiddlePath.cxx
BRepOffsetAPI_MiddlePath.hxx
BRepOffsetAPI_NormalProjection.cxx
BRepOffsetAPI_NormalProjection.hxx
BRepOffsetAPI_SequenceOfSequenceOfReal.hxx
BRepOffsetAPI_SequenceOfSequenceOfShape.hxx
BRepOffsetAPI_Sewing.hxx
BRepOffsetAPI_ThruSections.cxx
BRepOffsetAPI_ThruSections.hxx