function scene.cutWall(floor,point)
	local cutWall
	local anyCuts = false
	local logCuts = nothing

	if not floor.railing.enabled and floor.cuts then 
		
		local baseSection
		if type(point)=="table" then 
			baseSection = {0,0, point.dist,0, point.dist,floor.wall.height, 0,floor.wall.height}
		end

		cutWall = {baseSection}

		local inter   
		local sub 
		local in0,in1,in2
		local vin0,vin1,vin2
		local dir,iter,shp,n
		local travelling
		local i,temp, intersect
		local closest,interDist
		local onShape
		local used = {}
		local section

		for c,cut in ipairs(floor.cuts) do 
			if cut.index == point.index  then 
				for s,section in ipairs(cutWall) do
					int = math.intersectLines(cut.shape,section,true)[1]
					if int then 
						--n = int.n
						sub = {int.x,int.y}
						shp = cut.shape
						onShape = true
						in1 = point_in_poly(section, int.i1) 
						in2 = point_in_poly(section, int.i2) 

						if in1 or in2 then 
							in0 = in1 and int.i1 or int.i2
							dir = in1 and -2 or 2
							iter = in0.i
							classicConcat(sub,{in0.x,in0.y})   										 logCuts("step 1",inspect(sub))
							travelling = true
							local timeout = 0
							while travelling do 
								timeout=timeout+1
								if timeout>99 then 
									onShape=false
									break
								end
								if shp[iter] == sub[1] and shp[iter+1] == sub[2] then -- HOME POINT
									classicConcat(sub, {shp[iter],shp[iter+1]}) 				 logCuts("step 2",inspect(sub))
									travelling = false 
									onShape=false
									break
								end
								iter = iter+dir
								iter = iter<1 and #shp-1 or (iter>#shp and 1 or iter)
								
								intersect = nil
								closest = 9999

								local v2
								if not onShape then -- SHAPE INTERSECT
									for v=1,#cut.shape,2 do 
										i,temp = math.intersect (sub[#sub-1],   sub[#sub], 	shp[iter],  shp[iter+1], 
																						cut.shape[v], cut.shape[v+1],  cut.shape[v+2>#cut.shape and 1 or v+2], cut.shape[v+3>#cut.shape and 2 or v+3] )
										if i then 
											interDist = math.dist(sub[#sub-1],sub[#sub],temp.x,temp.y)
											if interDist<closest then 
												closest = interDist
												intersect = temp
												intersect.n = c
												v2 = v
											end
										end
									end
								end

								if  v2 then 
									vin1 = point_in_poly(shp,{x=cut.shape[v2], y=cut.shape[v2+1],  })
									vin2 = point_in_poly(shp,{x=cut.shape[v2+2>#cut.shape and 1 or v2+2], y=cut.shape[v2+3>#cut.shape and 2 or v2+3]})
									intersect.d = (vin2 or not vin1) 
								end


								if onShape then -- WALL INTERSECT
									local s1,s2 = {},{}
									local vt = 0
									for v=1,#section,2 do 
										vt = v+2>#section and 1 or v+2
										i,temp = math.intersect (
											sub[#sub-1],	sub[#sub], 	shp[iter],		shp[iter+1], 
											section[v], 								section[v+1],  						section[vt],	section[vt+1]
										)
										if i then 
											interDist = math.dist(sub[#sub-1],sub[#sub],temp.x,temp.y)
											if interDist<closest then 
												closest = interDist
												intersect = temp
												intersect.n = 0
												intersect.v = v
												intersect.vt = vt 
												s1.x,s1.y,s2.x,s2.y = section[v], section[v+1],  section[vt],section[vt+1]
											end
										end
									end

									if intersect then 
										classicConcat(sub, {intersect.x,intersect.y})   logCuts("step 3",inspect(sub))
										closest = 9999
										local pip1,pip2 = point_in_poly(shp,{x=s1.x,y=s1.y}),	point_in_poly(shp,{x=s2.x,y=s2.y})

										if pip1 or pip2 then 
											intersect.i = pip1 and intersect.vt or intersect.v
											intersect.d = pip1 and 2 or -2
										else 
											for s,sect in ipairs({s1,s2}) do 
												logCuts("intersecting line for cut "..c,sub[#sub-1],  sub[#sub]," to ", 	sect.x, sect.y)
												for v=1,#cut.shape,2 do 
													i,temp = math.intersect (
														sub[#sub-1],  sub[#sub], 	sect.x,																		sect.y, 
														cut.shape[v], 							cut.shape[v+1],  					cut.shape[v+2>#cut.shape and 1 or v+2], cut.shape[v+3>#cut.shape and 2 or v+3] 
													)

													if i and not (round(temp.x-sub[#sub-1],5)==0 and round(temp.y-sub[#sub],5)==0)  then 
														sect.discard=true
													end
												end
											end
											intersect.i = s2.discard and intersect.v or intersect.vt
											intersect.d = s2.discard and -2 or 2
										end

										onShape = false
										shp 		= section
										iter 		= intersect.i
										dir  		= intersect.d
										n 			= 0
										classicConcat(sub, {shp[iter],shp[iter+1]} )   logCuts("step 3",inspect(sub))
									end
								end


								if intersect  then 
									
									if round(intersect.x,5) == round(sub[1],5) and round(intersect.y,5) == round(sub[2],5) then -- HOME POINT
										--classicConcat(sub, {intersect.x,intersect.y}) logCuts(inspect(sub))
										travelling = false 
										onShape=false
										break
									elseif intersect.n == 0 then -- WALL INTERSECT
									end
								else
									classicConcat(sub, {shp[iter],shp[iter+1]} )   		--logCuts(inspect(sub))
								end
							end

							if not onShape then 
								anyCuts = true
								cutWall[s]=deepcopy(sub)
							end
						end
					end
				end
			end
		end

		for c,cut in ipairs(floor.cuts) do 
			if cut.index == point.index  then 
				section = deepcopy(cutWall[1])
				local contained=true 
				for v=1,#cut.shape,2 do 
					if not point_in_poly(section,{x=cut.shape[v],y=cut.shape[v+1]}) then 
						contained = false
					end
				end

				if contained then 
					local inters,closest = math.intersectLines(cut.shape,section,true)
					if #inters==0 and closest.j then 
						local shape = {}
						logCuts("closest.i",closest.i)
						local connectAngle 		= math.angle(section[closest.j],section[closest.j+1],cut.shape[closest.i],cut.shape[closest.i+1])+pi/2
						local separation 		  = vec2.from_cartesian(0.0001,connectAngle)

						logCuts("separation",separation)

						local sectionBefore 	= lume.slice(section, 1, closest.j+1)
						local sectionAfter  	= lume.slice(section,    closest.j)
						local sectionConnect1  = lume.slice(cut.shape,    closest.i,closest.i+1)
						local sectionConnect2  = lume.slice(cut.shape,    closest.i,closest.i+1)

						local v2
						shape = {}
						for v=1,#cut.shape-2,2 do 
							v2 = v + closest.i + 1
							logCuts("v2: "..v2,wrap2(1,v2,#cut.shape),getLooped(cut.shape,v2))
							table.insert(shape,getLooped(cut.shape,v2))
							table.insert(shape,getLooped(cut.shape,v2+1))
						end

						logCuts("pre crash")
						logCuts(inspect(shape))

						if cut.style == "rect" then 
							local shape2 = {}
							for v=1,#shape,2 do 
								table.insert(shape2,shape[#shape-v])
								table.insert(shape2,shape[#shape-v+1  ])
							end
							shape = deepcopy(shape2)
						end

						sectionBefore[#sectionBefore-1] = sectionBefore[#sectionBefore-1] + separation.x
						sectionBefore[#sectionBefore] 	= sectionBefore[#sectionBefore]   + separation.y

						sectionConnect1[1]  = sectionConnect1[1] + separation.x
						sectionConnect1[2]  = sectionConnect1[2] + separation.y
						sectionConnect2[1]  = sectionConnect2[1] - separation.x
						sectionConnect2[2]  = sectionConnect2[2] - separation.y

						sectionAfter[1] = sectionAfter[1] - separation.x
						sectionAfter[2] = sectionAfter[2] - separation.y

						section = lume.concat(sectionBefore,sectionConnect1,shape,sectionConnect2,sectionAfter)
						anyCuts = true
					end

					cutWall= {deepcopy(section)}
				end
			end
		end
	end
	return cutWall,anyCuts
end