Wedge vertices?

I’m working on a Plugin and looking to implement a feature that’ll re-insert Nodes after a user removes them and finishes a session.

Currently my setup uses x2 Wedges to create a ‘Plane’ between 3 Nodes as depicted below.
How would I be able to find these exact three points of the Model once the Nodes have been removed and there’s no evidence of their previous whereabouts?

Any help will be greatly appreciated!

image


EDIT:

I’ve found a method of doing so, however when I apply it to pre-existing terrain it generates multiple versions of the same Node - Does anyone have any theory on how I can prevent this?

	local Node = Instance.new('Part')
	Node.Anchored = true
	Node.Size = Vector3.new(1, 1, 1)
	Node.Transparency = 0.5
	
--||--||--||

function getCorners(part)	
	local cf = part.CFrame
	local size = part.Size

	local corners = {}

	local frontFaceCenter = (cf + cf.LookVector * size.Z/2)
	local backFaceCenter = (cf - cf.LookVector * size.Z/2)

	local bottomFrontEdgeCenter = frontFaceCenter - frontFaceCenter.UpVector * size.Y/2
	local topBackEdgeCenter = backFaceCenter + backFaceCenter.UpVector * size.Y/2
	
	corners.bottomFrontLeft = (bottomFrontEdgeCenter).Position
	corners.topBackRight = (topBackEdgeCenter).Position
	corners.bottomFrontRight = (bottomFrontEdgeCenter).Position
	
	return corners
end

--||--||--||

	for __,i in (Self.Parent:GetChildren(...)) do
		if i:IsA('Model') then
			
			local corners
			local Wedge1 = i:FindFirstChild('Wedge1')
			local Wedge2 = i:FindFirstChild('Wedge2')
			
			if Wedge1 and Wedge2 then
				corners = getCorners(Wedge1, ...)
				
				local Clone0 = Node:Clone(...)
				Clone0.CFrame = CFrame.new(corners.bottomFrontLeft)
				Clone0.Parent = Self
				
				local Clone1 = Node:Clone(...)
				Clone1.CFrame = CFrame.new(corners.topBackRight)
				Clone1.Parent = Self
				
				corners = getCorners(Wedge2)
				
				local Clone0 = Node:Clone(...)
				Clone0.CFrame = CFrame.new(corners.bottomFrontRight)
				Clone0.Parent = Self
			end
			
		end
	end

Hi there again lol . You can try getting the 4 corners of the wedge . there your half way there! Now you got to figure out whoch node you want to remove by comparing the direction it is facing

I would recommend to solve the simpler version of the problem first. Since you’re generating the 2x wedges, you would always know the orientation of the wedge (ie, where the 90 degree corner is in the object space versus the 2 45 degree corners). I would recommend to figure out where the 45 degree corners are located first for each wedge, then combine the two wedges and merge one of the nodes.
image