Rename bed_adhesion_size to disallowed_border_size

It is the size of the border around the build volume that is disallowed, which is more generic than just the size of the bed adhesion. This edge is not only for bed adhesion.

Contributes to issue CURA-2407.
This commit is contained in:
Ghostkeeper 2016-09-27 15:24:31 +02:00
parent 743ac85b99
commit f7e8340235
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -392,48 +392,48 @@ class BuildVolume(SceneNode):
[prime_x - PRIME_CLEARANCE, prime_y + PRIME_CLEARANCE],
])
bed_adhesion_size = self._getEdgeDisallowedSize()
disallowed_border_size = self._getEdgeDisallowedSize()
if disallowed_areas:
# Extend every area already in the disallowed_areas with the skirt size.
for area in disallowed_areas:
poly = Polygon(numpy.array(area, numpy.float32))
poly = poly.getMinkowskiHull(Polygon(approximatedCircleVertices(bed_adhesion_size)))
poly = poly.getMinkowskiHull(Polygon(approximatedCircleVertices(disallowed_border_size)))
areas.append(poly)
# Add the skirt areas around the borders of the build plate.
if bed_adhesion_size > 0:
if disallowed_border_size > 0:
half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2
half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2
areas.append(Polygon(numpy.array([
[-half_machine_width, -half_machine_depth],
[-half_machine_width, half_machine_depth],
[-half_machine_width + bed_adhesion_size, half_machine_depth - bed_adhesion_size],
[-half_machine_width + bed_adhesion_size, -half_machine_depth + bed_adhesion_size]
[-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size],
[-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size]
], numpy.float32)))
areas.append(Polygon(numpy.array([
[half_machine_width, half_machine_depth],
[half_machine_width, -half_machine_depth],
[half_machine_width - bed_adhesion_size, -half_machine_depth + bed_adhesion_size],
[half_machine_width - bed_adhesion_size, half_machine_depth - bed_adhesion_size]
[half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size],
[half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size]
], numpy.float32)))
areas.append(Polygon(numpy.array([
[-half_machine_width, half_machine_depth],
[half_machine_width, half_machine_depth],
[half_machine_width - bed_adhesion_size, half_machine_depth - bed_adhesion_size],
[-half_machine_width + bed_adhesion_size, half_machine_depth - bed_adhesion_size]
[half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size],
[-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size]
], numpy.float32)))
areas.append(Polygon(numpy.array([
[half_machine_width, -half_machine_depth],
[-half_machine_width, -half_machine_depth],
[-half_machine_width + bed_adhesion_size, -half_machine_depth + bed_adhesion_size],
[half_machine_width - bed_adhesion_size, -half_machine_depth + bed_adhesion_size]
[-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size],
[half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size]
], numpy.float32)))
# Check if the prime tower area intersects with any of the other areas.