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
01370f87
Commit
01370f87
authored
6 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Print3D: use annotations
parent
15cf78e2
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
object_print3d_utils/__init__.py
+60
-58
60 additions, 58 deletions
object_print3d_utils/__init__.py
object_print3d_utils/operators.py
+36
-36
36 additions, 36 deletions
object_print3d_utils/operators.py
with
96 additions
and
94 deletions
object_print3d_utils/__init__.py
+
60
−
58
View file @
01370f87
...
...
@@ -59,64 +59,66 @@ else:
class
Print3D_Scene_Props
(
PropertyGroup
):
export_format
=
EnumProperty
(
name
=
"
Format
"
,
description
=
"
Format type to export to
"
,
items
=
((
'
STL
'
,
"
STL
"
,
""
),
(
'
PLY
'
,
"
PLY
"
,
""
),
(
'
WRL
'
,
"
VRML2
"
,
""
),
(
'
X3D
'
,
"
X3D
"
,
""
),
(
'
OBJ
'
,
"
OBJ
"
,
""
)),
default
=
'
STL
'
,
)
use_export_texture
=
BoolProperty
(
name
=
"
Copy Textures
"
,
description
=
"
Copy textures on export to the output path
"
,
default
=
False
,
)
use_apply_scale
=
BoolProperty
(
name
=
"
Apply Scale
"
,
description
=
"
Apply scene scale setting on export
"
,
default
=
False
,
)
export_path
=
StringProperty
(
name
=
"
Export Directory
"
,
description
=
"
Path to directory where the files are created
"
,
default
=
"
//
"
,
maxlen
=
1024
,
subtype
=
"
DIR_PATH
"
,
)
thickness_min
=
FloatProperty
(
name
=
"
Thickness
"
,
description
=
"
Minimum thickness
"
,
subtype
=
'
DISTANCE
'
,
default
=
0.001
,
# 1mm
min
=
0.0
,
max
=
10.0
,
)
threshold_zero
=
FloatProperty
(
name
=
"
Threshold
"
,
description
=
"
Limit for checking zero area/length
"
,
default
=
0.0001
,
precision
=
5
,
min
=
0.0
,
max
=
0.2
,
)
angle_distort
=
FloatProperty
(
name
=
"
Angle
"
,
description
=
"
Limit for checking distorted faces
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
45.0
),
min
=
0.0
,
max
=
math
.
radians
(
180.0
),
)
angle_sharp
=
FloatProperty
(
name
=
"
Angle
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
160.0
),
min
=
0.0
,
max
=
math
.
radians
(
180.0
),
)
angle_overhang
=
FloatProperty
(
name
=
"
Angle
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
45.0
),
min
=
0.0
,
max
=
math
.
radians
(
90.0
),
)
export_format
:
EnumProperty
(
name
=
"
Format
"
,
description
=
"
Format type to export to
"
,
items
=
(
(
'
STL
'
,
"
STL
"
,
""
),
(
'
PLY
'
,
"
PLY
"
,
""
),
(
'
WRL
'
,
"
VRML2
"
,
""
),
(
'
X3D
'
,
"
X3D
"
,
""
),
(
'
OBJ
'
,
"
OBJ
"
,
""
),
),
default
=
'
STL
'
,
)
use_export_texture
:
BoolProperty
(
name
=
"
Copy Textures
"
,
description
=
"
Copy textures on export to the output path
"
,
default
=
False
,
)
use_apply_scale
:
BoolProperty
(
name
=
"
Apply Scale
"
,
description
=
"
Apply scene scale setting on export
"
,
default
=
False
,
)
export_path
:
StringProperty
(
name
=
"
Export Directory
"
,
description
=
"
Path to directory where the files are created
"
,
default
=
"
//
"
,
maxlen
=
1024
,
subtype
=
"
DIR_PATH
"
,
)
thickness_min
:
FloatProperty
(
name
=
"
Thickness
"
,
description
=
"
Minimum thickness
"
,
subtype
=
'
DISTANCE
'
,
default
=
0.001
,
# 1mm
min
=
0.0
,
max
=
10.0
,
)
threshold_zero
:
FloatProperty
(
name
=
"
Threshold
"
,
description
=
"
Limit for checking zero area/length
"
,
default
=
0.0001
,
precision
=
5
,
min
=
0.0
,
max
=
0.2
,
)
angle_distort
:
FloatProperty
(
name
=
"
Angle
"
,
description
=
"
Limit for checking distorted faces
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
45.0
),
min
=
0.0
,
max
=
math
.
radians
(
180.0
),
)
angle_sharp
:
FloatProperty
(
name
=
"
Angle
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
160.0
),
min
=
0.0
,
max
=
math
.
radians
(
180.0
),
)
angle_overhang
:
FloatProperty
(
name
=
"
Angle
"
,
subtype
=
'
ANGLE
'
,
default
=
math
.
radians
(
45.0
),
min
=
0.0
,
max
=
math
.
radians
(
90.0
),
)
# Update panel category name
...
...
This diff is collapsed.
Click to expand it.
object_print3d_utils/operators.py
+
36
−
36
View file @
01370f87
...
...
@@ -23,15 +23,15 @@
import
bpy
from
bpy.types
import
Operator
from
bpy.props
import
(
IntProperty
,
FloatProperty
,
)
IntProperty
,
FloatProperty
,
)
import
bmesh
from
.
import
(
mesh_helpers
,
report
,
)
mesh_helpers
,
report
,
)
def
clean_float
(
text
):
...
...
@@ -430,16 +430,16 @@ class MESH_OT_Print3D_Clean_Non_Manifold(Operator):
bl_label
=
"
Print3D Clean Non-Manifold and Inverted
"
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
threshold
=
bpy
.
props
.
FloatProperty
(
name
=
"
threshold
"
,
description
=
"
Minimum distance between elements to merge
"
,
default
=
0.0001
,
)
sides
=
bpy
.
props
.
IntProperty
(
name
=
"
sides
"
,
description
=
"
Number of sides in hole required to fill
"
,
default
=
4
,
)
threshold
:
bpy
.
props
.
FloatProperty
(
name
=
"
threshold
"
,
description
=
"
Minimum distance between elements to merge
"
,
default
=
0.0001
,
)
sides
:
bpy
.
props
.
IntProperty
(
name
=
"
sides
"
,
description
=
"
Number of sides in hole required to fill
"
,
default
=
4
,
)
def
execute
(
self
,
context
):
self
.
context
=
context
...
...
@@ -600,7 +600,7 @@ class MESH_OT_Print3D_Select_Report(Operator):
bl_label
=
"
Print3D Select Report
"
bl_options
=
{
'
INTERNAL
'
}
index
=
IntProperty
()
index
:
IntProperty
()
_type_to_mode
=
{
bmesh
.
types
.
BMVert
:
'
VERT
'
,
...
...
@@ -659,14 +659,14 @@ class MESH_OT_Print3D_Scale_To_Volume(Operator):
bl_label
=
"
Scale to Volume
"
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
volume_init
=
FloatProperty
(
options
=
{
'
HIDDEN
'
},
)
volume
=
FloatProperty
(
name
=
"
Volume
"
,
unit
=
'
VOLUME
'
,
min
=
0.0
,
max
=
100000.0
,
)
volume_init
:
FloatProperty
(
options
=
{
'
HIDDEN
'
},
)
volume
:
FloatProperty
(
name
=
"
Volume
"
,
unit
=
'
VOLUME
'
,
min
=
0.0
,
max
=
100000.0
,
)
def
execute
(
self
,
context
):
import
math
...
...
@@ -705,17 +705,17 @@ class MESH_OT_Print3D_Scale_To_Bounds(Operator):
bl_label
=
"
Scale to Bounds
"
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
length_init
=
FloatProperty
(
options
=
{
'
HIDDEN
'
},
)
axis_init
=
IntProperty
(
options
=
{
'
HIDDEN
'
},
)
length
=
FloatProperty
(
name
=
"
Length Limit
"
,
unit
=
'
LENGTH
'
,
min
=
0.0
,
max
=
100000.0
,
)
length_init
:
FloatProperty
(
options
=
{
'
HIDDEN
'
},
)
axis_init
:
IntProperty
(
options
=
{
'
HIDDEN
'
},
)
length
:
FloatProperty
(
name
=
"
Length Limit
"
,
unit
=
'
LENGTH
'
,
min
=
0.0
,
max
=
100000.0
,
)
def
execute
(
self
,
context
):
scale
=
self
.
length
/
self
.
length_init
...
...
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