Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pyMKcam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
pyMKcam
Commits
d46107ec
Commit
d46107ec
authored
Mar 24, 2012
by
Whitham D. Reeve II
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old commented out code.
parent
3e556f62
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
6 deletions
+0
-6
DXFImporter.py
pycam/Importers/DXFImporter.py
+0
-2
STLImporter.py
pycam/Importers/STLImporter.py
+0
-4
No files found.
pycam/Importers/DXFImporter.py
View file @
d46107ec
...
@@ -143,9 +143,7 @@ class DXFParser(object):
...
@@ -143,9 +143,7 @@ class DXFParser(object):
groups
.
append
(
current_group
)
groups
.
append
(
current_group
)
def
get_distance_between_groups
(
group1
,
group2
):
def
get_distance_between_groups
(
group1
,
group2
):
forward
=
pnorm
(
psub
(
group1
[
-
1
]
.
p2
,
group2
[
0
]
.
p1
))
forward
=
pnorm
(
psub
(
group1
[
-
1
]
.
p2
,
group2
[
0
]
.
p1
))
#forward = group1[-1].p2.sub(group2[0].p1).norm
backward
=
pnorm
(
psub
(
group2
[
-
1
]
.
p2
,
group1
[
0
]
.
p1
))
backward
=
pnorm
(
psub
(
group2
[
-
1
]
.
p2
,
group1
[
0
]
.
p1
))
#backward = group2[-1].p2.sub(group1[0].p1).norm
return
min
(
forward
,
backward
)
return
min
(
forward
,
backward
)
remaining_groups
=
groups
[:]
remaining_groups
=
groups
[:]
ordered_groups
=
[]
ordered_groups
=
[]
...
...
pycam/Importers/STLImporter.py
View file @
d46107ec
...
@@ -151,10 +151,8 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
...
@@ -151,10 +151,8 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
attribs
=
unpack
(
"<H"
,
f
.
read
(
2
))
attribs
=
unpack
(
"<H"
,
f
.
read
(
2
))
dotcross
=
pdot
(
n
,
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
dotcross
=
pdot
(
n
,
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
#dotcross = n.dot(p2.sub(p1).cross(p3.sub(p1)))
if
a1
==
a2
==
a3
==
0
:
if
a1
==
a2
==
a3
==
0
:
dotcross
=
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
))[
2
]
dotcross
=
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
))[
2
]
#dotcross = p2.sub(p1).cross(p3.sub(p1)).z
n
=
None
n
=
None
if
dotcross
>
0
:
if
dotcross
>
0
:
...
@@ -245,7 +243,6 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
...
@@ -245,7 +243,6 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
continue
continue
if
not
n
:
if
not
n
:
n
=
pnormalized
(
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
n
=
pnormalized
(
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
#n = p2.sub(p1).cross(p3.sub(p1)).normalized()
# validate the normal
# validate the normal
# The three vertices of a triangle in an STL file are supposed
# The three vertices of a triangle in an STL file are supposed
...
@@ -257,7 +254,6 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
...
@@ -257,7 +254,6 @@ def ImportModel(filename, use_kdtree=True, callback=None, **kwargs):
else
:
else
:
# make sure the points are in ClockWise order
# make sure the points are in ClockWise order
dotcross
=
pdot
(
n
,
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
dotcross
=
pdot
(
n
,
pcross
(
psub
(
p2
,
p1
),
psub
(
p3
,
p1
)))
#dotcross = n.dot(p2.sub(p1).cross(p3.sub(p1)))
if
dotcross
>
0
:
if
dotcross
>
0
:
# Triangle expects the vertices in clockwise order
# Triangle expects the vertices in clockwise order
t
=
Triangle
(
p1
,
p3
,
p2
,
n
)
t
=
Triangle
(
p1
,
p3
,
p2
,
n
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment