mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 05:07:50 -06:00
Use approximated circle for the prime polygons
It's much easier to create, more obvious code, and better approximates the area that we seek to use for our prime location. Contributes to issue CURA-2625.
This commit is contained in:
parent
3d9eb4f2be
commit
a37ab8f4b1
1 changed files with 12 additions and 7 deletions
|
@ -401,13 +401,8 @@ class BuildVolume(SceneNode):
|
||||||
prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2
|
prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2
|
||||||
prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value")
|
prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value")
|
||||||
|
|
||||||
prime_polygon = Polygon([
|
prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE)
|
||||||
[prime_x - PRIME_CLEARANCE, prime_y - PRIME_CLEARANCE],
|
prime_polygon = prime_polygon.translate(prime_x, prime_y)
|
||||||
[prime_x + PRIME_CLEARANCE, prime_y - PRIME_CLEARANCE],
|
|
||||||
[prime_x + PRIME_CLEARANCE, prime_y + PRIME_CLEARANCE],
|
|
||||||
[prime_x - PRIME_CLEARANCE, prime_y + PRIME_CLEARANCE],
|
|
||||||
])
|
|
||||||
prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(0))
|
|
||||||
collision = False
|
collision = False
|
||||||
|
|
||||||
# Check if prime polygon is intersecting with any of the other disallowed areas.
|
# Check if prime polygon is intersecting with any of the other disallowed areas.
|
||||||
|
@ -469,6 +464,16 @@ class BuildVolume(SceneNode):
|
||||||
self._has_errors = prime_tower_collision or prime_collision
|
self._has_errors = prime_tower_collision or prime_collision
|
||||||
self._disallowed_areas = result_areas
|
self._disallowed_areas = result_areas
|
||||||
|
|
||||||
|
## Computes the disallowed areas for objects that are printed.
|
||||||
|
#
|
||||||
|
# These disallowed areas are not offset with the negative of the nozzle
|
||||||
|
# offset, since the engine already performs the offset for us to make sure
|
||||||
|
# they are printed in head-coordinates instead of nozzle-coordinates.
|
||||||
|
#
|
||||||
|
# \return A list of polygons that represent the disallowed areas.
|
||||||
|
def _computeDisallowedAreasPrinted(self):
|
||||||
|
result = []
|
||||||
|
|
||||||
## Computes the disallowed areas that are statically placed in the machine.
|
## Computes the disallowed areas that are statically placed in the machine.
|
||||||
#
|
#
|
||||||
# These disallowed areas need to be offset with the negative of the nozzle
|
# These disallowed areas need to be offset with the negative of the nozzle
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue