Porównaj commity

...

26 Commity

Autor SHA1 Wiadomość Data
Alain Pelletier 79fcd0b920
Merge pull request #235 from pppalain/master
maintenance
2023-04-19 14:58:14 -03:00
palain cf6dfb14dd Add option to separate contour hatch curve. 2023-04-15 10:26:33 -03:00
Alain Pelletier e351735e8e
Merge pull request #88 from abosafia/master
crosshach to object depth
2023-04-15 10:18:52 -03:00
palain 9c69718d1d Add option to separate contour hatch curve. 2023-04-15 09:35:08 -03:00
abosafia 911d5bf464 delete old crosshatch 2023-04-15 13:36:23 +02:00
abosafia 76e68783b6 crosshach to object depth 2023-04-15 12:49:47 +02:00
palain a3f523839c Add option to separate contour hatch curve. 2023-04-14 16:55:08 -03:00
palain 02dd7d0da2 Add option to separate contour hatch curve. 2023-04-14 16:54:03 -03:00
palain 3025e30a1a Add option to separate contour hatch curve. 2023-04-14 14:40:17 -03:00
palain 362b6d3cff Add option to separate contour hatch curve. 2023-04-14 14:37:52 -03:00
palain 34b02d3716 Add option to separate contour hatch curve. 2023-04-14 14:36:37 -03:00
palain 18599720be add offset cleanout curve to crosshatch curves. 2023-04-14 14:24:59 -03:00
palain 52f8c7620f add offset cleanout curve to crosshatch curves. 2023-04-14 12:30:14 -03:00
palain ba8563a001 subdivide crosshatch curves. 2023-04-14 12:28:55 -03:00
Alain Pelletier 2f770c82e1
Merge pull request #87 from abosafia/master
remove middle from pocket option
2023-04-14 11:32:11 -03:00
Alain Pelletier 72423c598d
Merge branch 'master' into master 2023-04-14 11:31:55 -03:00
abosafia 58d28c3cbb remove middle from pocket option 2023-04-14 16:28:55 +02:00
palain 929d5ea373 subdivide crosshatch curves. 2023-04-14 11:26:18 -03:00
palain d69333e333 subdivide crosshatch curves. 2023-04-14 11:12:18 -03:00
palain 4f42e6f15a subdivide crosshatch curves. 2023-04-14 10:57:22 -03:00
Alain Pelletier bb2174e214
Merge pull request #84 from abosafia/master
clean pocket center if needed
2023-04-10 14:01:03 -03:00
abosafia 3590fae45a clean pocket center if needed 2023-04-10 18:48:16 +02:00
Alain Pelletier cb624c1307
Merge pull request #83 from abosafia/master
fix pocket left material at curve center
2023-04-10 09:26:55 -03:00
abosafia 19b0dc1b5e pocket starting position activated 2023-04-10 08:46:47 +02:00
abosafia 73fd399115 fix pocket left material at curve center 2023-04-07 18:55:54 +02:00
palain c17c2cc6aa pocket closing for center - fixes rectangle pockets 2023-04-03 14:52:00 -03:00
4 zmienionych plików z 58 dodań i 8 usunięć

Wyświetl plik

@ -603,8 +603,8 @@ class camOperation(bpy.types.PropertyGroup):
# pocket options
pocket_option: EnumProperty(name='Start Position', items=(
('INSIDE', 'Inside', 'a'), ('OUTSIDE', 'Outside', 'a'), ('MIDDLE', 'Middle', 'a')),
description='Pocket starting position', default='MIDDLE', update=updateRest)
('INSIDE', 'Inside', 'a'), ('OUTSIDE', 'Outside', 'a')),
description='Pocket starting position', default='INSIDE', update=updateRest)
pocketToCurve: bpy.props.BoolProperty(name="Pocket to curve",
description="generates a curve instead of a path",
default=False, update=updateRest)

Wyświetl plik

@ -43,8 +43,11 @@ class CamCurveHatch(bpy.types.Operator):
angle: bpy.props.FloatProperty(name="angle", default=0, min=-math.pi/2, max=math.pi/2, precision=4, subtype="ANGLE")
distance: bpy.props.FloatProperty(name="spacing", default=0.015, min=0, max=3.0, precision=4, unit="LENGTH")
offset: bpy.props.FloatProperty(name="Margin", default=0.001, min=-1.0, max=3.0, precision=4, unit="LENGTH")
height: bpy.props.FloatProperty(name="Height", default=0.000, min=-1.0, max=1.0, precision=4, unit="LENGTH")
amount: bpy.props.IntProperty(name="amount", default=10, min=1, max=10000)
hull: bpy.props.BoolProperty(name="Convex Hull", default=False)
contour: bpy.props.BoolProperty(name="Contour Curve", default=False)
contour_separate: bpy.props.BoolProperty(name="Contour separate", default=False)
pocket_type: EnumProperty(name='Type pocket',
items=(('BOUNDS', 'makes a bounds rectangle', 'makes a bounding square'),
('POCKET', 'Pocket', 'makes a pocket inside a closed loop')),
@ -54,12 +57,35 @@ class CamCurveHatch(bpy.types.Operator):
def poll(cls, context):
return context.active_object is not None and context.active_object.type in ['CURVE', 'FONT']
def draw(self, context):
layout = self.layout
layout.prop(self, 'angle')
layout.prop(self, 'distance')
layout.prop(self, 'offset')
layout.prop(self, 'height')
layout.prop(self, 'pocket_type')
if self.pocket_type == 'POCKET':
if self.hull:
layout.prop(self, 'hull')
layout.prop(self, 'contour')
if self.contour:
layout.prop(self, 'contour_separate')
else:
layout.prop(self, 'hull')
if self.contour:
layout.prop(self, 'contour')
def execute(self, context):
simple.remove_multiple("crosshatch")
ob = context.active_object
ob.select_set(True)
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY', center='MEDIAN')
depth = ob.location[2]
if self.hull:
bpy.ops.object.convex_hull()
simple.active_name('crosshatch_hull')
from shapely import affinity
from shapely.ops import voronoi_diagram
shapes = utils.curveToShapely(bpy.context.active_object)
for s in shapes.geoms:
coords = []
@ -68,15 +94,12 @@ class CamCurveHatch(bpy.types.Operator):
miny -= self.offset
maxx += self.offset
maxy += self.offset
centery = (miny + maxy) / 2
height = maxy - miny
width = maxx - minx
centerx = (minx+maxx) / 2
diagonal = math.hypot(width, height)
simple.add_bound_rectangle(minx, miny, maxx, maxy, 'crosshatch_bound')
amount = int(2*diagonal/self.distance) + 1
for x in range(amount):
@ -96,13 +119,33 @@ class CamCurveHatch(bpy.types.Operator):
xing = translated.intersection(s.buffer(self.offset))
# Shapely detects intersections with the original curve or hull
utils.shapelyToCurve('crosshatch_lines', xing, 0)
utils.shapelyToCurve('crosshatch_lines', xing, self.height)
# remove temporary shapes
simple.remove_multiple('crosshatch_bound')
simple.remove_multiple('crosshatch_hull')
simple.select_multiple('crosshatch')
bpy.ops.object.editmode_toggle()
bpy.ops.curve.select_all(action='SELECT')
bpy.ops.curve.subdivide()
bpy.ops.object.editmode_toggle()
simple.join_multiple('crosshatch')
simple.remove_doubles()
# add contour
if self.contour:
simple.deselect()
bpy.context.view_layer.objects.active = ob
ob.select_set(True)
bpy.ops.object.silhouete_offset(offset=self.offset)
if self.contour_separate:
simple.active_name('contour_hatch')
simple.deselect()
else:
simple.active_name('crosshatch_contour')
simple.join_multiple('crosshatch')
simple.remove_doubles()
return {'FINISHED'}

Wyświetl plik

@ -330,6 +330,11 @@ def pocket(o):
nchunks = shapelyToChunks(p, o.min.z)
# print("nchunks")
pnew = p.buffer(-o.dist_between_paths, o.circle_detail)
if pnew.is_empty:
pt = p.buffer(-c_offset, o.circle_detail) # test if the last curve will leave material
if not pt.is_empty:
pnew = pt
# print("pnew")
nchunks = limitChunks(nchunks, o)

Wyświetl plik

@ -1074,6 +1074,8 @@ def sortChunks(chunks, o):
# chunks[:] = []
i -= 1
if o.strategy == 'POCKET' and o.pocket_option == 'OUTSIDE':
sortedchunks.reverse()
sys.setrecursionlimit(1000)
if o.strategy != 'DRILL' and o.strategy != 'OUTLINEFILL':