Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rocolib
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
roco
rocolib
Merge requests
!29
Face2face
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Face2face
mehtank/rocolib:face2face
into
v0.3
Overview
0
Commits
4
Pipelines
1
Changes
10
Merged
mehtank
requested to merge
mehtank/rocolib:face2face
into
v0.3
3 years ago
Overview
0
Commits
4
Pipelines
1
Changes
10
Expand
Replace copyDecorations in utils with Face-Face connection (fixes
#18 (closed)
)
0
0
Merge request reports
Compare
v0.3
v0.3 (base)
and
latest version
latest version
3f13d351
4 commits,
3 years ago
10 files
+
86
−
80
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
rocolib/api/composables/graph/Face.py
+
27
−
8
Options
@@ -221,10 +221,7 @@ class Face(object):
self
.
decorations
.
append
(
pts
)
def
addFace
(
self
,
face
,
transform
,
copyDecorations
=
False
):
self
.
joinedFaces
.
append
((
face
,
transform
))
if
copyDecorations
:
for
d
in
self
.
decorations
:
face
.
addDecoration
(
d
)
self
.
joinedFaces
.
append
(
dict
(
face
=
face
,
transform
=
transform
,
copyDecorations
=
copyDecorations
))
def
preTransform
(
self
,
edge
):
index
=
self
.
edges
.
index
(
edge
)
@@ -332,16 +329,38 @@ class Face(object):
e
.
remove
(
self
)
# now place attached faces
for
(
f
,
t
)
in
self
.
joinedFaces
:
for
jf
in
self
.
joinedFaces
:
if
jf
[
"
transform
"
]
is
False
:
continue
if
self
.
inverted
:
t3d
=
np
.
dot
(
MirrorZ
(),
t
)
t3d
=
np
.
dot
(
MirrorZ
(),
jf
[
"
transform
"
]
)
else
:
t3d
=
t
t3d
=
jf
[
"
transform
"
]
t3d
=
np
.
dot
(
self
.
transform3D
,
t3d
)
f
.
place
(
None
,
None
,
t3d
,
facelists
)
jf
[
"
face
"
]
.
place
(
None
,
None
,
t3d
,
facelists
)
self
.
placeagain
()
def
copyDecorations
(
self
):
for
jf
in
self
.
joinedFaces
:
if
jf
[
"
copyDecorations
"
]:
thisdeco
=
self
.
transformDecorations
(
np
.
inv
(
jf
[
"
face
"
].
transform3D
))
thatdeco
=
jf
[
"
face
"
].
transformDecorations
(
np
.
inv
(
self
.
transform3D
))
self
.
decorations
+=
thatdeco
jf
[
"
face
"
].
decorations
+=
thisdeco
jf
[
"
copyDecorations
"
]
=
False
def
transformDecorations
(
self
,
t2
=
None
):
if
self
.
transform3D
is
None
:
return
t
=
self
.
transform3D
if
t2
is
not
None
:
t
=
np
.
dot
(
t2
,
t
)
decorations
=
[]
for
e
in
self
.
decorations
:
decorations
.
append
(([
np
.
dot
(
t
,
np
.
array
(
list
(
pt
)
+
[
0
,
1
]))[
0
:
2
]
for
pt
in
e
[
0
]
],
e
[
1
]))
return
decorations
def
polygon
(
self
):
from
collections
import
namedtuple
from
shapely.geometry
import
Polygon