Add Center Function on Holes
Calculates the center of the hole.
This commit is contained in:
@@ -149,18 +149,18 @@ func hit(position: Vector3):
|
||||
# translate the cutter
|
||||
var hole_vectors = Transform2D(0, hole_vector2_offset) * cutter
|
||||
|
||||
var rtree_search = []
|
||||
for hv in hole_vectors:
|
||||
rtree_search.append_array(inner_rtree.query(hv))
|
||||
|
||||
var draw = _add_hole(hole_vectors, rtree_search)
|
||||
var draw = _add_hole(hole_vectors)
|
||||
|
||||
if draw:
|
||||
_re_draw()
|
||||
|
||||
func _add_hole(new_hole: PackedVector2Array, holes_id: PackedInt32Array) -> bool:
|
||||
func _add_hole(new_hole: PackedVector2Array) -> bool:
|
||||
var ids_to_remove = []
|
||||
|
||||
var holes_id = []
|
||||
for vector in new_hole:
|
||||
holes_id.append_array(inner_rtree.query(vector))
|
||||
|
||||
# validate that the hole is valid
|
||||
var boundary_polygon = Geometry2D.offset_polygon(outer_polygon, -edge_non_fracture)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user