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
Analyze
Contributor 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
gmsh
gmsh
Commits
3c4ee4ae
Commit
3c4ee4ae
authored
2 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
more info for debugging
parent
9b95d6c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#9768
passed
2 years ago
Stage: test
Stage: .post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/geo/GModelAutoExtrude.cpp
+62
-29
62 additions, 29 deletions
src/geo/GModelAutoExtrude.cpp
with
62 additions
and
29 deletions
src/geo/GModelAutoExtrude.cpp
+
62
−
29
View file @
3c4ee4ae
...
@@ -217,48 +217,81 @@ void getCandidateExtrudeInfo(GRegion *gr, std::vector<extrudeInfo> &info,
...
@@ -217,48 +217,81 @@ void getCandidateExtrudeInfo(GRegion *gr, std::vector<extrudeInfo> &info,
for
(
auto
f2
:
f
)
{
for
(
auto
f2
:
f
)
{
// for each pair of surfaces
// for each pair of surfaces
if
(
f1
==
f2
)
continue
;
if
(
f1
==
f2
)
continue
;
Msg
::
Debug
(
"Testing surface pair %d - %d:"
,
f1
->
tag
(),
f2
->
tag
());
auto
f2v
=
f2
->
vertices
();
auto
f2v
=
f2
->
vertices
();
auto
f2e
=
f2
->
edges
();
auto
f2e
=
f2
->
edges
();
std
::
set
<
GVertex
*
,
GEntityPtrLessThan
>
v2
(
f2v
.
begin
(),
f2v
.
end
());
std
::
set
<
GVertex
*
,
GEntityPtrLessThan
>
v2
(
f2v
.
begin
(),
f2v
.
end
());
std
::
set
<
GEdge
*
,
GEntityPtrLessThan
>
e2
(
f2e
.
begin
(),
f2e
.
end
());
std
::
set
<
GEdge
*
,
GEntityPtrLessThan
>
e2
(
f2e
.
begin
(),
f2e
.
end
());
// abort if different topology
// abort if different topology
if
((
v1
.
size
()
!=
v2
.
size
())
||
(
e1
.
size
()
!=
e2
.
size
()))
continue
;
if
((
v1
.
size
()
!=
v2
.
size
())
||
(
e1
.
size
()
!=
e2
.
size
()))
{
Msg
::
Debug
(
" - incompatible surfaces %d (#points=%lu, #curves=%lu) - "
"%d (#points=%lu, #curves=%lu)"
,
f1
->
tag
(),
v1
.
size
(),
e1
.
size
(),
f2
->
tag
(),
v2
.
size
(),
e2
.
size
());
continue
;
}
SVector3
t0
(
0.
,
0.
,
0.
);
SVector3
t0
(
0.
,
0.
,
0.
);
bool
translated
=
true
;
bool
translated
=
true
;
// check all curves not on the boundary of the 2 surfaces
std
::
set
<
GEdge
*>
perp
;
for
(
auto
e
:
gr
->
edges
())
{
for
(
auto
e
:
gr
->
edges
())
{
if
(
e1
.
find
(
e
)
==
e1
.
end
()
&&
e2
.
find
(
e
)
==
e2
.
end
())
{
// skip curves that are on the boundary of the 2 surfaces
if
(
e1
.
find
(
e
)
!=
e1
.
end
()
||
e2
.
find
(
e
)
!=
e2
.
end
())
{
continue
;
}
if
((
v1
.
find
(
e
->
getBeginVertex
())
!=
v1
.
end
()
||
v1
.
find
(
e
->
getEndVertex
())
!=
v1
.
end
())
&&
(
v2
.
find
(
e
->
getBeginVertex
())
!=
v2
.
end
()
||
v2
.
find
(
e
->
getEndVertex
())
!=
v2
.
end
()))
{
perp
.
insert
(
e
);
}
}
// straight lines with the same translation vector?
if
(
perp
.
size
()
!=
v1
.
size
())
{
if
(
e
->
geomType
()
==
GEntity
::
Line
)
{
Msg
::
Debug
(
" - number of extruded curves differs from number of "
GVertex
*
vs
=
e
->
getBeginVertex
(),
*
vt
=
e
->
getEndVertex
();
"source/target surface points (%lu != %lu)"
,
if
(
vs
&&
vt
)
{
perp
.
size
(),
v1
.
size
());
SVector3
t
;
continue
;
if
(
v1
.
find
(
vs
)
!=
v1
.
end
()
&&
v2
.
find
(
vt
)
!=
v2
.
end
())
{
}
t
=
SVector3
(
vs
->
xyz
(),
vt
->
xyz
());
}
if
(
perp
.
size
()
+
e1
.
size
()
+
e2
.
size
()
!=
gr
->
edges
().
size
())
{
else
if
(
v1
.
find
(
vt
)
!=
v1
.
end
()
&&
v2
.
find
(
vs
)
!=
v2
.
end
())
{
Msg
::
Debug
(
" - extra curves not connected to source/target surfaces"
);
t
=
SVector3
(
vt
->
xyz
(),
vs
->
xyz
());
continue
;
}
}
else
{
translated
=
false
;
for
(
auto
e
:
perp
)
{
break
;
// straight lines with the same translation vector?
}
if
(
e
->
geomType
()
==
GEntity
::
Line
)
{
if
(
t0
.
norm
()
==
0.
)
t0
=
t
;
GVertex
*
vs
=
e
->
getBeginVertex
(),
*
vt
=
e
->
getEndVertex
();
if
(
!
sameDir
(
t0
,
t
))
{
if
(
vs
&&
vt
)
{
translated
=
false
;
SVector3
t
;
break
;
if
(
v1
.
find
(
vs
)
!=
v1
.
end
()
&&
v2
.
find
(
vt
)
!=
v2
.
end
())
{
}
t
=
SVector3
(
vs
->
xyz
(),
vt
->
xyz
());
}
else
if
(
v1
.
find
(
vt
)
!=
v1
.
end
()
&&
v2
.
find
(
vs
)
!=
v2
.
end
())
{
t
=
SVector3
(
vt
->
xyz
(),
vs
->
xyz
());
}
else
{
// should not happen
translated
=
false
;
break
;
}
if
(
t0
.
norm
()
==
0.
)
t0
=
t
;
if
(
!
sameDir
(
t0
,
t
))
{
Msg
::
Debug
(
" - straight line t=(%g, %g, %g) != t0=(%g, %g, %g)"
,
t
.
x
(),
t
.
y
(),
t
.
z
(),
t0
.
x
(),
t0
.
y
(),
t0
.
z
());
translated
=
false
;
break
;
}
}
}
}
else
{
}
// TODO: could check here if all curves are circles to detect
else
{
// extrusions by rotation
// TODO: could check here if all curves are circles to detect
translated
=
false
;
// extrusions by rotation
break
;
translated
=
false
;
}
break
;
}
}
}
}
if
(
translated
&&
t0
.
norm
()
!=
0.
)
{
if
(
translated
&&
t0
.
norm
()
!=
0.
)
{
...
...
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