Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
11aa3392
Commit
11aa3392
authored
1 year ago
by
Markus Frank
Committed by
MarkusFrankATcernch
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Correctly handle quadrilinear facets in tessellated shapes.
parent
63aa094d
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
DDCAD/include/DDCAD/Utilities.h
+0
-20
0 additions, 20 deletions
DDCAD/include/DDCAD/Utilities.h
DDCAD/src/ASSIMPReader.cpp
+6
-1
6 additions, 1 deletion
DDCAD/src/ASSIMPReader.cpp
with
6 additions
and
21 deletions
DDCAD/include/DDCAD/Utilities.h
+
0
−
20
View file @
11aa3392
...
...
@@ -54,25 +54,6 @@ namespace dd4hep {
}
// Determine if the facet is degenerated by calculating its determinant
inline
bool
facetIsDegenerated
(
std
::
vector
<
ROOT
::
Geom
::
Vertex_t
>
const
&
vertices
){
#if 0
const ROOT::Geom::Vertex_t& v1 = vertices[0];
const ROOT::Geom::Vertex_t& v2 = vertices[1];
const ROOT::Geom::Vertex_t& v3 = vertices[2];
constexpr double epsilon = std::numeric_limits<double>::epsilon();
// v1.x v2.x v3.x v1.x v2.x
//
// v1.y v2.y v3.y v1.y v2.y
//
// v1.z v2.z v3.z v1.z v2.z
double det = 0.0
+ v1.x() * v2.y() * v3.z()
+ v2.x() * v3.y() * v1.z()
+ v3.x() * v1.y() * v2.z()
- v1.z() * v2.y() * v3.x()
- v2.z() * v3.y() * v1.x()
- v3.z() * v1.y() * v2.x();
return std::fabs(det) < epsilon;
#else
using
ROOT
::
Geom
::
Vertex_t
;
// Compute normal using non-zero segments
constexpr
double
kTolerance
=
1.e-20
;
...
...
@@ -99,7 +80,6 @@ namespace dd4hep {
break
;
}
return
degenerated
;
#endif
}
}
}
...
...
This diff is collapsed.
Click to expand it.
DDCAD/src/ASSIMPReader.cpp
+
6
−
1
View file @
11aa3392
...
...
@@ -117,7 +117,12 @@ ASSIMPReader::readVolumes(const std::string& source, double unit_length) const
/// assigns the proper indices to the facet.
for
(
unsigned
int
i
=
0
;
i
<
mesh
->
mNumFaces
;
i
++
)
{
const
unsigned
int
*
idx
=
mesh
->
mFaces
[
i
].
mIndices
;
bool
degenerated
=
dd4hep
::
cad
::
facetIsDegenerated
({
vertices
[
idx
[
0
]],
vertices
[
idx
[
1
]],
vertices
[
idx
[
2
]]});
bool
degenerated
=
false
;
if
(
mesh
->
mFaces
[
i
].
mNumIndices
==
3
)
degenerated
=
dd4hep
::
cad
::
facetIsDegenerated
({
vertices
[
idx
[
0
]],
vertices
[
idx
[
1
]],
vertices
[
idx
[
2
]]});
else
if
(
mesh
->
mFaces
[
i
].
mNumIndices
==
4
)
degenerated
=
dd4hep
::
cad
::
facetIsDegenerated
({
vertices
[
idx
[
0
]],
vertices
[
idx
[
1
]],
vertices
[
idx
[
2
]],
vertices
[
idx
[
3
]]});
if
(
degenerated
)
{
printout
(
DEBUG
,
"ASSIMPReader"
,
"+++ %s: Drop degenerated facet: %d %d %d"
,
name
.
c_str
(),
idx
[
0
],
idx
[
1
],
idx
[
2
]);
...
...
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