- fix an older issue that made that only the Custom choice created an effect when changing the Offset in the Geometry Object Tool Table
This commit is contained in:
parent
263ec736c3
commit
b6d4d5e85f
@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- fixed an issue in Tool Isolation used with tools from the Tools Database: the set offset value was not used
|
- fixed an issue in Tool Isolation used with tools from the Tools Database: the set offset value was not used
|
||||||
- updated the Tools Database to include all the Geometry keys in the every tool from database
|
- updated the Tools Database to include all the Geometry keys in the every tool from database
|
||||||
- made sure that the Operation Type values ('Iso', 'Rough' and 'Finish') are not translated as this may create issues all over the application
|
- made sure that the Operation Type values ('Iso', 'Rough' and 'Finish') are not translated as this may create issues all over the application
|
||||||
|
- fix an older issue that made that only the Custom choice created an effect when changing the Offset in the Geometry Object Tool Table
|
||||||
|
|
||||||
2.11.2020
|
2.11.2020
|
||||||
|
|
||||||
|
@ -2287,7 +2287,7 @@ class GeometryObject(FlatCAMObj, Geometry):
|
|||||||
# current_uid = int(k)
|
# current_uid = int(k)
|
||||||
# break
|
# break
|
||||||
|
|
||||||
if dia_cnc_dict['offset'] == 'in':
|
if dia_cnc_dict['offset'].lower() == 'in':
|
||||||
tool_offset = -tooldia_val / 2
|
tool_offset = -tooldia_val / 2
|
||||||
elif dia_cnc_dict['offset'].lower() == 'out':
|
elif dia_cnc_dict['offset'].lower() == 'out':
|
||||||
tool_offset = tooldia_val / 2
|
tool_offset = tooldia_val / 2
|
||||||
|
15
camlib.py
15
camlib.py
@ -3517,15 +3517,22 @@ class CNCjob(Geometry):
|
|||||||
p = self.pp_geometry
|
p = self.pp_geometry
|
||||||
|
|
||||||
# Offset the Geometry if it is the case
|
# Offset the Geometry if it is the case
|
||||||
# FIXME need to test if in ["Path", "In", "Out", "Custom"]. For now only 'Custom' is somehow done
|
if tools[tool]['offset'].lower() == 'in':
|
||||||
offset = tools[tool]['offset_value']
|
tool_offset = -float(tools[tool]['tooldia']) / 2.0
|
||||||
if offset != 0.0:
|
elif tools[tool]['offset'].lower() == 'out':
|
||||||
|
tool_offset = float(tools[tool]['tooldia']) / 2.0
|
||||||
|
elif tools[tool]['offset'].lower() == 'custom':
|
||||||
|
tool_offset = tools[tool]['offset_value']
|
||||||
|
else:
|
||||||
|
tool_offset = 0.0
|
||||||
|
|
||||||
|
if tool_offset != 0.0:
|
||||||
for it in flat_geometry:
|
for it in flat_geometry:
|
||||||
# if the geometry is a closed shape then create a Polygon out of it
|
# if the geometry is a closed shape then create a Polygon out of it
|
||||||
if isinstance(it, LineString):
|
if isinstance(it, LineString):
|
||||||
if it.is_ring:
|
if it.is_ring:
|
||||||
it = Polygon(it)
|
it = Polygon(it)
|
||||||
temp_solid_geometry.append(it.buffer(offset, join_style=2))
|
temp_solid_geometry.append(it.buffer(tool_offset, join_style=2))
|
||||||
temp_solid_geometry = self.flatten(temp_solid_geometry, reset=True, pathonly=True)
|
temp_solid_geometry = self.flatten(temp_solid_geometry, reset=True, pathonly=True)
|
||||||
else:
|
else:
|
||||||
temp_solid_geometry = flat_geometry
|
temp_solid_geometry = flat_geometry
|
||||||
|
Loading…
Reference in New Issue
Block a user