kopia lustrzana https://github.com/vilemduha/blendercam
Reference repair returns...
rodzic
f05f007ccc
commit
d49b870d48
|
|
@ -30,15 +30,15 @@
|
|||
|
||||

|
||||
|
||||
or you can use "Object silhouete" from blendercam tool :
|
||||
or you can use "Object silhouette" from blendercam tool :
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
9. Edit curves to separate holes from external contour.
|
||||
|
||||

|
||||

|
||||
|
||||
10. Add Pocket and Profile operations :
|
||||
|
||||
|
|
|
|||
|
|
@ -1123,7 +1123,7 @@ class CamOperation(PropertyGroup):
|
|||
offset_image = numpy.array([], dtype=float)
|
||||
zbuffer_image = numpy.array([], dtype=float)
|
||||
|
||||
silhouete = sgeometry.Polygon()
|
||||
silhouette = sgeometry.Polygon()
|
||||
ambient = sgeometry.Polygon()
|
||||
operation_limit = sgeometry.Polygon()
|
||||
borderwidth = 50
|
||||
|
|
@ -1147,7 +1147,7 @@ class CamOperation(PropertyGroup):
|
|||
description="Mark for update",
|
||||
default=True,
|
||||
)
|
||||
update_silhouete_tag: BoolProperty(
|
||||
update_silhouette_tag: BoolProperty(
|
||||
name="Mark Silhouette Image for Update",
|
||||
description="Mark for update",
|
||||
default=True,
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class CamCurveHatch(Operator):
|
|||
simple.deselect()
|
||||
bpy.context.view_layer.objects.active = ob
|
||||
ob.select_set(True)
|
||||
bpy.ops.object.silhouete_offset(offset=self.offset)
|
||||
bpy.ops.object.silhouette_offset(offset=self.offset)
|
||||
if self.contour_separate:
|
||||
simple.active_name("contour_hatch")
|
||||
simple.deselect()
|
||||
|
|
|
|||
|
|
@ -755,7 +755,7 @@ class CamMeshGetPockets(Operator):
|
|||
class CamOffsetSilhouete(Operator):
|
||||
"""Curve Offset Operation"""
|
||||
|
||||
bl_idname = "object.silhouete_offset"
|
||||
bl_idname = "object.silhouette_offset"
|
||||
bl_label = "Silhouette & Offset"
|
||||
bl_options = {"REGISTER", "UNDO", "PRESET"}
|
||||
|
||||
|
|
@ -934,7 +934,7 @@ class CamOffsetSilhouete(Operator):
|
|||
class CamObjectSilhouete(Operator):
|
||||
"""Object Silhouette"""
|
||||
|
||||
bl_idname = "object.silhouete"
|
||||
bl_idname = "object.silhouette"
|
||||
bl_label = "Object Silhouette"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ async def get_path(context, operation):
|
|||
operation.update_z_buffer_image_tag = True
|
||||
operation.change_data = chd
|
||||
|
||||
operation.update_silhouete_tag = True
|
||||
operation.update_silhouette_tag = True
|
||||
operation.update_ambient_tag = True
|
||||
operation.update_bullet_collision_tag = True
|
||||
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ def get_path_pattern(operation):
|
|||
# pathchunks=sort_chunks(pathchunks,o)not until they get hierarchy parents!
|
||||
elif o.strategy == "OUTLINEFILL":
|
||||
|
||||
polys = o.silhouete.geoms
|
||||
polys = o.silhouette.geoms
|
||||
pathchunks = []
|
||||
chunks = []
|
||||
for p in polys:
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class AddPresetCamOperation(AddPresetBase, Operator):
|
|||
"o.slice_detail",
|
||||
"o.drill_type",
|
||||
"o.dont_merge",
|
||||
"o.update_silhouete_tag",
|
||||
"o.update_silhouette_tag",
|
||||
"o.inverse",
|
||||
"o.waterline_fill",
|
||||
"o.strategy",
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "BLOCK"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "BLOCK"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CIRCLES"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CIRCLES"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CROSS"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CROSS"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CUTOUT"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "OUTLINEFILL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "PARALLEL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "PARALLEL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "PENCIL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "POCKET"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "SPIRAL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "SPIRAL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.009999999776482582
|
|||
o.strategy = "CROSS"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = False
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "BLOCK"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "BLOCK"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "CIRCLES"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "CIRCLES"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "CROSS"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "CROSS"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "CUTOUT"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "OUTLINEFILL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "PARALLEL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "PARALLEL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "PENCIL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "POCKET"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "SPIRAL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ o.stepdown = 0.003
|
|||
o.strategy = "SPIRAL"
|
||||
o.testing = 0
|
||||
o.update_offset_image_tag = False
|
||||
o.update_silhouete_tag = True
|
||||
o.update_silhouette_tag = True
|
||||
o.update_z_buffer_image_tag = False
|
||||
o.use_layers = True
|
||||
o.use_limit_curve = False
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ def fingers(diameter, inside, amount=1, stem=1):
|
|||
|
||||
# Receptacle is made using the silhouette offset from the fingers
|
||||
if inside > 0:
|
||||
bpy.ops.object.silhouete_offset(offset=inside, style="1")
|
||||
bpy.ops.object.silhouette_offset(offset=inside, style="1")
|
||||
simple.active_name("receptacle")
|
||||
simple.move(y=-inside)
|
||||
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ async def pocket(o):
|
|||
|
||||
checkc = affinity.translate(checkc, p[0], p[1])
|
||||
covers = False
|
||||
for poly in o.silhouete.geoms:
|
||||
for poly in o.silhouette.geoms:
|
||||
if poly.contains(checkc):
|
||||
covers = True
|
||||
break
|
||||
|
|
@ -697,7 +697,7 @@ async def pocket(o):
|
|||
rothelix.reverse()
|
||||
|
||||
covers = False
|
||||
for poly in o.silhouete.geoms:
|
||||
for poly in o.silhouette.geoms:
|
||||
if poly.contains(coutline):
|
||||
covers = True
|
||||
break
|
||||
|
|
@ -1054,7 +1054,7 @@ async def medial_axis(o):
|
|||
lines = shapely.ops.linemerge(ledges)
|
||||
# print(lines.type)
|
||||
|
||||
if bufpoly.type == "Polygon" or bufpoly.type == "MultiPolygon":
|
||||
if bufpoly.geom_type == "Polygon" or bufpoly.geom_type == "MultiPolygon":
|
||||
lines = lines.difference(bufpoly)
|
||||
|
||||
chunks.extend(shapely_to_chunks(bufpoly, maxdepth))
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ class VIEW3D_PT_tools_curvetools(Panel):
|
|||
column.operator("object.curve_overcuts", icon="CON_SIZELIKE")
|
||||
column.operator("object.curve_overcuts_b", icon="CON_SIZELIKE")
|
||||
column = col.column(align=True)
|
||||
column.operator("object.silhouete", icon="USER", text="Object Silhouette")
|
||||
column.operator("object.silhouete_offset", icon="COMMUNITY", text="Silhouette Offset")
|
||||
column.operator("object.silhouette", icon="USER", text="Object Silhouette")
|
||||
column.operator("object.silhouette_offset", icon="COMMUNITY", text="Silhouette Offset")
|
||||
col.operator(
|
||||
"object.curve_remove_doubles", icon="FORCE_CHARGE", text="Remove Curve Doubles"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ class VIEW3D_MT_tools_curvetools(Menu):
|
|||
layout.operator("object.curve_intarsion")
|
||||
layout.operator("object.curve_overcuts")
|
||||
layout.operator("object.curve_overcuts_b")
|
||||
# layout.operator("object.silhouete")
|
||||
layout.operator("object.silhouete_offset")
|
||||
# layout.operator("object.silhouette")
|
||||
layout.operator("object.silhouette_offset")
|
||||
layout.operator("object.curve_remove_doubles")
|
||||
layout.operator("object.mesh_get_pockets")
|
||||
layout.operator("object.cam_pack_objects")
|
||||
|
|
|
|||
|
|
@ -1748,7 +1748,7 @@ def get_operation_silhouette(operation):
|
|||
Returns:
|
||||
Silhouette: The computed silhouette for the operation.
|
||||
"""
|
||||
if operation.update_silhouete_tag:
|
||||
if operation.update_silhouette_tag:
|
||||
image = None
|
||||
objects = None
|
||||
if operation.geometry_source == "OBJECT" or operation.geometry_source == "COLLECTION":
|
||||
|
|
@ -1778,17 +1778,17 @@ def get_operation_silhouette(operation):
|
|||
i = samples > numpy.min(operation.zbuffer_image)
|
||||
|
||||
chunks = image_to_chunks(operation, i)
|
||||
operation.silhouete = chunks_to_shapely(chunks)
|
||||
# print(operation.silhouete)
|
||||
operation.silhouette = chunks_to_shapely(chunks)
|
||||
# print(operation.silhouette)
|
||||
# this conversion happens because we need the silh to be oriented, for milling directions.
|
||||
else:
|
||||
print("object method for retrieving silhouette") #
|
||||
operation.silhouete = get_object_silhouette(
|
||||
operation.silhouette = get_object_silhouette(
|
||||
stype, objects=operation.objects, use_modifiers=operation.use_modifiers
|
||||
)
|
||||
|
||||
operation.update_silhouete_tag = False
|
||||
return operation.silhouete
|
||||
operation.update_silhouette_tag = False
|
||||
return operation.silhouette
|
||||
|
||||
|
||||
def get_object_silhouette(stype, objects=None, use_modifiers=False):
|
||||
|
|
@ -1817,7 +1817,7 @@ def get_object_silhouette(stype, objects=None, use_modifiers=False):
|
|||
for ob in objects:
|
||||
chunks = curve_to_chunks(ob)
|
||||
allchunks.extend(chunks)
|
||||
silhouete = chunks_to_shapely(allchunks)
|
||||
silhouette = chunks_to_shapely(allchunks)
|
||||
|
||||
elif stype == "OBJECTS":
|
||||
totfaces = 0
|
||||
|
|
@ -1885,9 +1885,9 @@ def get_object_silhouette(stype, objects=None, use_modifiers=False):
|
|||
print("time:", time.time() - t)
|
||||
|
||||
t = time.time()
|
||||
silhouete = shapely_to_multipolygon(p) # [polygon_utils_cam.Shapely2Polygon(p)]
|
||||
silhouette = shapely_to_multipolygon(p) # [polygon_utils_cam.Shapely2Polygon(p)]
|
||||
|
||||
return silhouete
|
||||
return silhouette
|
||||
|
||||
|
||||
def get_ambient(o):
|
||||
|
|
@ -1916,7 +1916,7 @@ def get_ambient(o):
|
|||
|
||||
if o.ambient_behaviour == "AROUND":
|
||||
r = o.ambient_radius - m
|
||||
# in this method we need ambient from silhouete
|
||||
# in this method we need ambient from silhouette
|
||||
o.ambient = get_object_outline(r, o, True)
|
||||
else:
|
||||
o.ambient = spolygon.Polygon(
|
||||
|
|
@ -3034,7 +3034,7 @@ def get_strategy_list(scene, context):
|
|||
(
|
||||
"CUTOUT",
|
||||
"Profile (Cutout)",
|
||||
"Cut the silhouete with offset",
|
||||
"Cut the silhouette with offset",
|
||||
"MOD_SKIN",
|
||||
0,
|
||||
),
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue