Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
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
Container registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
8c65dec4
Commit
8c65dec4
authored
8 years ago
by
Antonioya
Browse files
Options
Downloads
Patches
Plain Diff
Archimesh: Fix import error for math module
parent
a9778838
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
archimesh/achm_main_panel.py
+14
-13
14 additions, 13 deletions
archimesh/achm_main_panel.py
with
14 additions
and
13 deletions
archimesh/achm_main_panel.py
+
14
−
13
View file @
8c65dec4
...
@@ -28,6 +28,7 @@ import bpy
...
@@ -28,6 +28,7 @@ import bpy
# noinspection PyUnresolvedReferences
# noinspection PyUnresolvedReferences
import
bgl
import
bgl
from
bpy.types
import
Operator
,
Panel
,
SpaceView3D
from
bpy.types
import
Operator
,
Panel
,
SpaceView3D
from
math
import
sqrt
,
fabs
,
pi
,
asin
from
.achm_tools
import
*
from
.achm_tools
import
*
from
.achm_gltools
import
*
from
.achm_gltools
import
*
...
@@ -280,7 +281,7 @@ class AchmPencilAction(Operator):
...
@@ -280,7 +281,7 @@ class AchmPencilAction(Operator):
i
=
len
(
mypoints
)
i
=
len
(
mypoints
)
distlist
=
[]
distlist
=
[]
for
e
in
range
(
1
,
i
):
for
e
in
range
(
1
,
i
):
d
=
math
.
sqrt
(
d
=
sqrt
(
((
mypoints
[
e
][
0
]
-
mypoints
[
e
-
1
][
0
])
**
2
)
+
((
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
**
2
))
((
mypoints
[
e
][
0
]
-
mypoints
[
e
-
1
][
0
])
**
2
)
+
((
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
**
2
))
# Imperial units if needed
# Imperial units if needed
if
bpy
.
context
.
scene
.
unit_settings
.
system
==
"
IMPERIAL
"
:
if
bpy
.
context
.
scene
.
unit_settings
.
system
==
"
IMPERIAL
"
:
...
@@ -300,12 +301,12 @@ class AchmPencilAction(Operator):
...
@@ -300,12 +301,12 @@ class AchmPencilAction(Operator):
i
=
len
(
mypoints
)
i
=
len
(
mypoints
)
anglelist
=
[]
anglelist
=
[]
for
e
in
range
(
1
,
i
):
for
e
in
range
(
1
,
i
):
sinv
=
(
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
/
math
.
sqrt
(
sinv
=
(
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
/
sqrt
(
((
mypoints
[
e
][
0
]
-
mypoints
[
e
-
1
][
0
])
**
2
)
+
((
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
**
2
))
((
mypoints
[
e
][
0
]
-
mypoints
[
e
-
1
][
0
])
**
2
)
+
((
mypoints
[
e
][
1
]
-
mypoints
[
e
-
1
][
1
])
**
2
))
a
=
math
.
asin
(
sinv
)
a
=
asin
(
sinv
)
# Clamp to 90 or 0 degrees
# Clamp to 90 or 0 degrees
if
math
.
fabs
(
a
)
>
math
.
pi
/
4
:
if
fabs
(
a
)
>
pi
/
4
:
b
=
math
.
pi
/
2
b
=
pi
/
2
else
:
else
:
b
=
0
b
=
0
...
@@ -320,8 +321,8 @@ class AchmPencilAction(Operator):
...
@@ -320,8 +321,8 @@ class AchmPencilAction(Operator):
distlist
[
e
-
1
]
*=
-
1
# reverse distance
distlist
[
e
-
1
]
*=
-
1
# reverse distance
if
debugmode
is
True
:
if
debugmode
is
True
:
print
(
str
(
e
-
1
)
+
"
:
"
+
str
((
a
*
180
)
/
math
.
pi
)
+
"
...:
"
+
str
(
print
(
str
(
e
-
1
)
+
"
:
"
+
str
((
a
*
180
)
/
pi
)
+
"
...:
"
+
str
(
(
b
*
180
)
/
math
.
pi
)
+
"
--->
"
+
str
(
distlist
[
e
-
1
]))
(
b
*
180
)
/
pi
)
+
"
--->
"
+
str
(
distlist
[
e
-
1
]))
# ---------------------------------------
# ---------------------------------------
# Verify duplications and reduce noise
# Verify duplications and reduce noise
...
@@ -365,17 +366,17 @@ class AchmPencilAction(Operator):
...
@@ -365,17 +366,17 @@ class AchmPencilAction(Operator):
i
=
len
(
mypoints
)
i
=
len
(
mypoints
)
for
e
in
range
(
0
,
i
-
1
):
for
e
in
range
(
0
,
i
-
1
):
if
clearangles
[
e
]
==
math
.
pi
/
2
:
if
clearangles
[
e
]
==
pi
/
2
:
if
cleardistan
[
e
]
>
0
:
if
cleardistan
[
e
]
>
0
:
mydata
.
walls
[
e
].
w
=
round
(
math
.
fabs
(
cleardistan
[
e
]),
2
)
mydata
.
walls
[
e
].
w
=
round
(
fabs
(
cleardistan
[
e
]),
2
)
mydata
.
walls
[
e
].
r
=
(
math
.
fabs
(
clearangles
[
e
])
*
180
)
/
math
.
pi
# from radians
mydata
.
walls
[
e
].
r
=
(
fabs
(
clearangles
[
e
])
*
180
)
/
pi
# from radians
else
:
else
:
mydata
.
walls
[
e
].
w
=
round
(
math
.
fabs
(
cleardistan
[
e
]),
2
)
mydata
.
walls
[
e
].
w
=
round
(
fabs
(
cleardistan
[
e
]),
2
)
mydata
.
walls
[
e
].
r
=
(
math
.
fabs
(
clearangles
[
e
])
*
180
*
-
1
)
/
math
.
pi
# from radians
mydata
.
walls
[
e
].
r
=
(
fabs
(
clearangles
[
e
])
*
180
*
-
1
)
/
pi
# from radians
else
:
else
:
mydata
.
walls
[
e
].
w
=
round
(
cleardistan
[
e
],
2
)
mydata
.
walls
[
e
].
w
=
round
(
cleardistan
[
e
],
2
)
mydata
.
walls
[
e
].
r
=
(
math
.
fabs
(
clearangles
[
e
])
*
180
)
/
math
.
pi
# from radians
mydata
.
walls
[
e
].
r
=
(
fabs
(
clearangles
[
e
])
*
180
)
/
pi
# from radians
# Remove Grease pencil
# Remove Grease pencil
if
pencil
is
not
None
:
if
pencil
is
not
None
:
...
...
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