mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Fix possibly wrong disallowed area display
CURA-11293
This commit is contained in:
parent
0c78cdbdbd
commit
6539841f3e
1 changed files with 10 additions and 9 deletions
|
@ -489,20 +489,21 @@ class BuildVolume(SceneNode):
|
||||||
if not self._disallowed_areas:
|
if not self._disallowed_areas:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
bounding_box = Polygon(numpy.array([[min_w, min_d], [min_w, max_d], [max_w, max_d], [max_w, min_d]], numpy.float32))
|
||||||
|
|
||||||
mb = MeshBuilder()
|
mb = MeshBuilder()
|
||||||
color = self._disallowed_area_color
|
color = self._disallowed_area_color
|
||||||
for polygon in self._disallowed_areas:
|
for polygon in self._disallowed_areas:
|
||||||
points = polygon.getPoints()
|
intersection = polygon.intersectionConvexHulls(bounding_box)
|
||||||
if len(points) == 0:
|
|
||||||
|
points = intersection.getPoints()[::-1]
|
||||||
|
if len(points) < 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
first = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height,
|
first = Vector(points[0][0], disallowed_area_height, points[0][1])
|
||||||
self._clamp(points[0][1], min_d, max_d))
|
previous_point = Vector(points[1][0], disallowed_area_height, points[1][1])
|
||||||
previous_point = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height,
|
for point in points[2:]:
|
||||||
self._clamp(points[0][1], min_d, max_d))
|
new_point = Vector(point[0], disallowed_area_height, point[1])
|
||||||
for point in points:
|
|
||||||
new_point = Vector(self._clamp(point[0], min_w, max_w), disallowed_area_height,
|
|
||||||
self._clamp(point[1], min_d, max_d))
|
|
||||||
mb.addFace(first, previous_point, new_point, color=color)
|
mb.addFace(first, previous_point, new_point, color=color)
|
||||||
previous_point = new_point
|
previous_point = new_point
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue