Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
6581e72e
Commit
6581e72e
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
only add closed wires as edge loops
parent
8c97de4e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/OCCFace.cpp
+41
-35
41 additions, 35 deletions
Geo/OCCFace.cpp
Geo/OCCIncludes.h
+1
-0
1 addition, 0 deletions
Geo/OCCIncludes.h
with
42 additions
and
35 deletions
Geo/OCCFace.cpp
+
41
−
35
View file @
6581e72e
...
@@ -30,45 +30,51 @@ extern Context_T CTX;
...
@@ -30,45 +30,51 @@ extern Context_T CTX;
OCCFace
::
OCCFace
(
GModel
*
m
,
TopoDS_Face
_s
,
int
num
,
TopTools_IndexedMapOfShape
&
emap
)
OCCFace
::
OCCFace
(
GModel
*
m
,
TopoDS_Face
_s
,
int
num
,
TopTools_IndexedMapOfShape
&
emap
)
:
GFace
(
m
,
num
),
s
(
_s
)
:
GFace
(
m
,
num
),
s
(
_s
)
{
{
TopExp_Explorer
exp0
,
exp01
,
exp1
,
exp2
,
exp3
;
TopExp_Explorer
exp2
,
exp3
;
for
(
exp2
.
Init
(
s
,
TopAbs_WIRE
);
exp2
.
More
();
exp2
.
Next
()){
for
(
exp2
.
Init
(
s
,
TopAbs_WIRE
);
exp2
.
More
();
exp2
.
Next
()){
TopoDS_Shape
wire
=
exp2
.
Current
();
TopoDS_Wire
wire
=
TopoDS
::
Wire
(
exp2
.
Current
());
Msg
::
Debug
(
"OCC Face %d - New Wire"
,
num
);
ShapeAnalysis_Wire
check
(
wire
,
s
,
0.
);
std
::
list
<
GEdge
*>
l_wire
;
// only add closed wires (yes, the test is correct: CheckClosed
for
(
exp3
.
Init
(
wire
,
TopAbs_EDGE
);
exp3
.
More
();
exp3
.
Next
()){
// returns false when the wire is closed)
TopoDS_Edge
edge
=
TopoDS
::
Edge
(
exp3
.
Current
());
if
(
check
.
CheckClosed
()){
int
index
=
emap
.
FindIndex
(
edge
);
Msg
::
Debug
(
"OCC Face %d - Skipping open Wire"
,
num
);
GEdge
*
e
=
m
->
getEdgeByTag
(
index
);
}
if
(
e
){
else
{
l_wire
.
push_back
(
e
);
Msg
::
Debug
(
"OCC Face %d - New Wire"
,
num
);
Msg
::
Debug
(
"Edge %d ori %d"
,
e
->
tag
(),
edge
.
Orientation
());
std
::
list
<
GEdge
*>
l_wire
;
e
->
addFace
(
this
);
for
(
exp3
.
Init
(
wire
,
TopAbs_EDGE
);
exp3
.
More
();
exp3
.
Next
()){
if
(
!
e
->
is3D
()){
TopoDS_Edge
edge
=
TopoDS
::
Edge
(
exp3
.
Current
());
OCCEdge
*
occe
=
(
OCCEdge
*
)
e
;
int
index
=
emap
.
FindIndex
(
edge
);
occe
->
setTrimmed
(
this
);
GEdge
*
e
=
m
->
getEdgeByTag
(
index
);
}
if
(
e
){
}
l_wire
.
push_back
(
e
);
else
{
Msg
::
Debug
(
"Edge %d ori %d"
,
e
->
tag
(),
edge
.
Orientation
());
Msg
::
Error
(
"Unknown edge %d in face %d"
,
index
,
num
);
e
->
addFace
(
this
);
}
if
(
!
e
->
is3D
()){
}
OCCEdge
*
occe
=
(
OCCEdge
*
)
e
;
occe
->
setTrimmed
(
this
);
GEdgeLoop
el
(
l_wire
);
}
}
else
{
Msg
::
Error
(
"Unknown edge %d in face %d"
,
index
,
num
);
}
}
for
(
GEdgeLoop
::
citer
it
=
el
.
begin
();
it
!=
el
.
end
();
++
it
){
GEdgeLoop
el
(
l_wire
);
l_edges
.
push_back
(
it
->
ge
);
for
(
GEdgeLoop
::
citer
it
=
el
.
begin
();
it
!=
el
.
end
();
++
it
){
l_dirs
.
push_back
(
it
->
_sign
);
l_edges
.
push_back
(
it
->
ge
);
if
(
el
.
count
()
==
2
){
l_dirs
.
push_back
(
it
->
_sign
);
it
->
ge
->
meshAttributes
.
minimumMeshSegments
=
if
(
el
.
count
()
==
2
){
std
::
max
(
it
->
ge
->
meshAttributes
.
minimumMeshSegments
,
2
);
it
->
ge
->
meshAttributes
.
minimumMeshSegments
=
}
std
::
max
(
it
->
ge
->
meshAttributes
.
minimumMeshSegments
,
2
);
if
(
el
.
count
()
==
1
){
}
it
->
ge
->
meshAttributes
.
minimumMeshSegments
=
if
(
el
.
count
()
==
1
){
std
::
max
(
it
->
ge
->
meshAttributes
.
minimumMeshSegments
,
3
);
it
->
ge
->
meshAttributes
.
minimumMeshSegments
=
std
::
max
(
it
->
ge
->
meshAttributes
.
minimumMeshSegments
,
3
);
}
}
}
edgeLoops
.
push_back
(
el
);
}
}
edgeLoops
.
push_back
(
el
);
}
}
BRepAdaptor_Surface
surface
(
s
);
BRepAdaptor_Surface
surface
(
s
);
_periodic
[
0
]
=
surface
.
IsUPeriodic
();
_periodic
[
0
]
=
surface
.
IsUPeriodic
();
...
...
This diff is collapsed.
Click to expand it.
Geo/OCCIncludes.h
+
1
−
0
View file @
6581e72e
...
@@ -93,6 +93,7 @@ using std::iostream;
...
@@ -93,6 +93,7 @@ using std::iostream;
#include
"ShapeAnalysis_ShapeContents.hxx"
#include
"ShapeAnalysis_ShapeContents.hxx"
#include
"ShapeAnalysis_CheckSmallFace.hxx"
#include
"ShapeAnalysis_CheckSmallFace.hxx"
#include
"ShapeAnalysis_DataMapOfShapeListOfReal.hxx"
#include
"ShapeAnalysis_DataMapOfShapeListOfReal.hxx"
#include
"ShapeAnalysis_Wire.hxx"
#include
"BRepAlgoAPI_Fuse.hxx"
#include
"BRepAlgoAPI_Fuse.hxx"
#include
"BRepCheck_Analyzer.hxx"
#include
"BRepCheck_Analyzer.hxx"
#include
"BRepLib.hxx"
#include
"BRepLib.hxx"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment