Question: Maple error troubleshooting: " Error, break or next outside do loop "

Please help me understand why this error occurs:

 

PlanesTetrahedron := proc (A, B, C, D)

local plane1 := 0; plane2 := 0; plane3 := 0; plane4 := 0; Plane1 := 0; Plane2 := 0; Plane3 := 0; Plane4 := 0; M := 0; CutPoint1 := 0; CutPoint2 := 0; CutPoint3 := 0; CutPoint4 := 0; V := 0; Temp1 := 0; Temp2 := 0; Temp3 := 0; Temp4 := 0; S1 := 0; S2 := 0; S3 := 0; S4 := 0; temp := 0;

plane1 := Equation(A, [x, y, z]);

plane2 := Equation(B, [x, y, z]);

plane3 := Equation(C, [x, y, z]);

plane4 := Equation(D, [x, y, z]);

S1 := solve({plane1, plane2, plane3}, [x, y, z]);

S2 := solve({plane1, plane2, plane4}, [x, y, z]);

S3 := solve({plane2, plane3, plane4}, [x, y, z]);

S4 := solve({plane1, plane3, plane4}, [x, y, z]);

if nops(S1) = 0 then temp := 1 end if;

if nops(S2) = 0 then temp := 2 end if;

if nops(S3) = 0 then temp := 3 end if;

if nops(S4) = 0 then temp := 4 end if;

if temp <> 0 then

printf("Error: At least 2 planes do not have cut point. Please change the plane equation, and try again.");

break; end if;

 

end proc

Please Wait...