Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
ShapeAnalysis_FreeBounds Class Reference

This class is intended to output free bounds of the shape. More...

#include <ShapeAnalysis_FreeBounds.hxx>

Public Member Functions

 ShapeAnalysis_FreeBounds ()
 Empty constructor.
 
 ShapeAnalysis_FreeBounds (const TopoDS_Shape &shape, const double toler, const bool splitclosed=false, const bool splitopen=true)
 Builds forecasting free bounds of the <shape>. <shape> should be a compound of faces. This constructor is to be used for forecasting free edges with help of sewing analyzer BRepAlgo_Sewing which is called with tolerance <toler>. Free edges are connected into wires only when their ends are at distance less than <toler>. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.
 
 ShapeAnalysis_FreeBounds (const TopoDS_Shape &shape, const bool splitclosed=false, const bool splitopen=true, const bool checkinternaledges=false)
 Builds actual free bounds of the <shape>. <shape> should be a compound of shells. This constructor is to be used for getting free edges (ones referenced by the only face) with help of analyzer ShapeAnalysis_Shell. Free edges are connected into wires only when they share the same vertex. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.
 
const TopoDS_CompoundGetClosedWires () const
 Returns compound of closed wires out of free edges.
 
const TopoDS_CompoundGetOpenWires () const
 Returns compound of open wires out of free edges.
 

Static Public Member Functions

static occ::handle< NCollection_HSequence< TopoDS_Shape > > ConnectEdgesToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &edges, const double toler, const bool shared)
 Builds sequence of <wires> out of sequence of not sorted <edges>. Tries to build wires of maximum length. Building a wire is stopped when no edges can be connected to it at its head or at its tail.
 
static void ConnectEdgesToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &edges, const double toler, const bool shared, occ::handle< NCollection_HSequence< TopoDS_Shape > > &wires)
 
static occ::handle< NCollection_HSequence< TopoDS_Shape > > ConnectWiresToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &iwires, const double toler, const bool shared)
 Connects wires from the given sequence into longer wires.
 
static void ConnectWiresToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &iwires, const double toler, const bool shared, occ::handle< NCollection_HSequence< TopoDS_Shape > > &owires)
 
static occ::handle< NCollection_HSequence< TopoDS_Shape > > ConnectWiresToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &iwires, const double toler, const bool shared, NCollection_DataMap< TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher > &vertices)
 Builds sequence of <owires> out of sequence of not sorted <iwires>. Tries to build wires of maximum length. Building a wire is stopped when no wires can be connected to it at its head or at its tail.
 
static void ConnectWiresToWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &iwires, const double toler, const bool shared, occ::handle< NCollection_HSequence< TopoDS_Shape > > &owires, NCollection_DataMap< TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher > &vertices)
 
static void SplitWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &wires, const double toler, const bool shared, occ::handle< NCollection_HSequence< TopoDS_Shape > > &closed, occ::handle< NCollection_HSequence< TopoDS_Shape > > &open)
 Extracts closed sub-wires out of <wires> and adds them to <closed>, open wires remained after extraction are put into <open>. If <shared> is True extraction is performed only when edges share the same vertex. If <shared> is False connection is performed only when ends of the edges are at distance less than <toler>.
 
static void DispatchWires (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &wires, TopoDS_Compound &closed, TopoDS_Compound &open)
 Dispatches sequence of <wires> into two compounds <closed> for closed wires and <open> for open wires. If a compound is not empty wires are added into it.
 

Detailed Description

This class is intended to output free bounds of the shape.

Free bounds are the wires consisting of edges referenced by the faces of the shape only once; these are the edges composing the outer boundary of the face or shell (as opposed to internal edges between the faces in the shell or seam edges on closed faces).

This class works on two distinct types of shapes when analyzing their free bounds:

  1. compound of faces. Analyzer of sewing algorithm (BRepAlgo_Sewing) is used for for forecasting free bounds that would be obtained after performing sewing
  2. compound of shells. Actual free bounds (edges shared by the only face in the shell) are output in this case. ShapeAnalysis_Shell is used for that.

When connecting edges into the wires algorithm tries to build wires of maximum length. Two options are provided for a user to extract closed sub-contours out of closed and/or open contours.

Free bounds are returned as two compounds, one for closed and one for open wires.

This class also provides some static methods for advanced use: connecting edges/wires to wires, extracting closed sub-wires out of wires, dispatching wires into compounds for closed and open wires. NOTE. Ends of the edge or wire mean hereafter their end vertices.

Constructor & Destructor Documentation

◆ ShapeAnalysis_FreeBounds() [1/3]

ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds ( )

Empty constructor.

◆ ShapeAnalysis_FreeBounds() [2/3]

ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds ( const TopoDS_Shape & shape,
const double toler,
const bool splitclosed = false,
const bool splitopen = true )

Builds forecasting free bounds of the <shape>. <shape> should be a compound of faces. This constructor is to be used for forecasting free edges with help of sewing analyzer BRepAlgo_Sewing which is called with tolerance <toler>. Free edges are connected into wires only when their ends are at distance less than <toler>. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.

◆ ShapeAnalysis_FreeBounds() [3/3]

ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds ( const TopoDS_Shape & shape,
const bool splitclosed = false,
const bool splitopen = true,
const bool checkinternaledges = false )

Builds actual free bounds of the <shape>. <shape> should be a compound of shells. This constructor is to be used for getting free edges (ones referenced by the only face) with help of analyzer ShapeAnalysis_Shell. Free edges are connected into wires only when they share the same vertex. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.

Member Function Documentation

◆ ConnectEdgesToWires() [1/2]

static occ::handle< NCollection_HSequence< TopoDS_Shape > > ShapeAnalysis_FreeBounds::ConnectEdgesToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & edges,
const double toler,
const bool shared )
static

Builds sequence of <wires> out of sequence of not sorted <edges>. Tries to build wires of maximum length. Building a wire is stopped when no edges can be connected to it at its head or at its tail.

Orientation of the edge can change when connecting. If <shared> is True connection is performed only when adjacent edges share the same vertex. If <shared> is False connection is performed only when ends of adjacent edges are at distance less than <toler>. Connects edges from the given sequence into wires.

Parameters
[in]edgesthe sequence of edges to connect
[in]tolerdistance tolerance for connection
[in]sharedif true, connection uses shared vertices only
Returns
sequence of resulting wires

◆ ConnectEdgesToWires() [2/2]

static void ShapeAnalysis_FreeBounds::ConnectEdgesToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & edges,
const double toler,
const bool shared,
occ::handle< NCollection_HSequence< TopoDS_Shape > > & wires )
static
Deprecated

Use ConnectEdgesToWires() returning handle by value instead.

("Use ConnectEdgesToWires() returning handle by value instead")

◆ ConnectWiresToWires() [1/4]

static occ::handle< NCollection_HSequence< TopoDS_Shape > > ShapeAnalysis_FreeBounds::ConnectWiresToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & iwires,
const double toler,
const bool shared )
static

Connects wires from the given sequence into longer wires.

Parameters
[in]iwiresthe sequence of input wires
[in]tolerdistance tolerance for connection
[in]sharedif true, connection uses shared vertices only
Returns
sequence of resulting wires

◆ ConnectWiresToWires() [2/4]

static occ::handle< NCollection_HSequence< TopoDS_Shape > > ShapeAnalysis_FreeBounds::ConnectWiresToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & iwires,
const double toler,
const bool shared,
NCollection_DataMap< TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher > & vertices )
static

Builds sequence of <owires> out of sequence of not sorted <iwires>. Tries to build wires of maximum length. Building a wire is stopped when no wires can be connected to it at its head or at its tail.

Orientation of the wire can change when connecting. If <shared> is True connection is performed only when adjacent wires share the same vertex. If <shared> is False connection is performed only when ends of adjacent wires are at distance less than <toler>. Map <vertices> stores the correspondence between original end vertices of the wires and new connecting vertices. Connects wires from the given sequence into longer wires. Also fills the map of original to new connecting vertices.

Parameters
[in]iwiresthe sequence of input wires
[in]tolerdistance tolerance for connection
[in]sharedif true, connection uses shared vertices only
[out]verticesmap of original vertices to new connecting vertices
Returns
sequence of resulting wires

◆ ConnectWiresToWires() [3/4]

static void ShapeAnalysis_FreeBounds::ConnectWiresToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & iwires,
const double toler,
const bool shared,
occ::handle< NCollection_HSequence< TopoDS_Shape > > & owires )
static
Deprecated

Use ConnectWiresToWires() returning handle by value instead.

("Use ConnectWiresToWires() returning handle by value instead")

◆ ConnectWiresToWires() [4/4]

static void ShapeAnalysis_FreeBounds::ConnectWiresToWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & iwires,
const double toler,
const bool shared,
occ::handle< NCollection_HSequence< TopoDS_Shape > > & owires,
NCollection_DataMap< TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher > & vertices )
static
Deprecated

Use ConnectWiresToWires() returning handle by value instead.

("Use ConnectWiresToWires() returning handle by value instead")

◆ DispatchWires()

static void ShapeAnalysis_FreeBounds::DispatchWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & wires,
TopoDS_Compound & closed,
TopoDS_Compound & open )
static

Dispatches sequence of <wires> into two compounds <closed> for closed wires and <open> for open wires. If a compound is not empty wires are added into it.

◆ GetClosedWires()

const TopoDS_Compound & ShapeAnalysis_FreeBounds::GetClosedWires ( ) const

Returns compound of closed wires out of free edges.

◆ GetOpenWires()

const TopoDS_Compound & ShapeAnalysis_FreeBounds::GetOpenWires ( ) const

Returns compound of open wires out of free edges.

◆ SplitWires()

static void ShapeAnalysis_FreeBounds::SplitWires ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & wires,
const double toler,
const bool shared,
occ::handle< NCollection_HSequence< TopoDS_Shape > > & closed,
occ::handle< NCollection_HSequence< TopoDS_Shape > > & open )
static

Extracts closed sub-wires out of <wires> and adds them to <closed>, open wires remained after extraction are put into <open>. If <shared> is True extraction is performed only when edges share the same vertex. If <shared> is False connection is performed only when ends of the edges are at distance less than <toler>.


The documentation for this class was generated from the following file: