Merge pull request 'dev' (#256) from dev into dev-deploy
Reviewed-on: #256
This commit is contained in:
commit
6b1ad5bbd4
@ -6,7 +6,6 @@ import EavesGableEdit from '@/components/floor-plan/modal/eavesGable/EavesGableE
|
|||||||
import MovementSetting from '@/components/floor-plan/modal/movement/MovementSetting'
|
import MovementSetting from '@/components/floor-plan/modal/movement/MovementSetting'
|
||||||
import WallLineOffsetSetting from '@/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting'
|
import WallLineOffsetSetting from '@/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting'
|
||||||
import RoofAllocationSetting from '@/components/floor-plan/modal/roofAllocation/RoofAllocationSetting'
|
import RoofAllocationSetting from '@/components/floor-plan/modal/roofAllocation/RoofAllocationSetting'
|
||||||
import Slope from '@/components/floor-plan/modal/Slope'
|
|
||||||
import PlacementShapeDrawing from '@/components/floor-plan/modal/placementShape/PlacementShapeDrawing'
|
import PlacementShapeDrawing from '@/components/floor-plan/modal/placementShape/PlacementShapeDrawing'
|
||||||
import PlacementSurfaceSetting from '@/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting'
|
import PlacementSurfaceSetting from '@/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting'
|
||||||
import ObjectSetting from '@/components/floor-plan/modal/object/ObjectSetting'
|
import ObjectSetting from '@/components/floor-plan/modal/object/ObjectSetting'
|
||||||
@ -20,9 +19,8 @@ import { useRecoilState, useRecoilValue } from 'recoil'
|
|||||||
import { canvasState, currentMenuState } from '@/store/canvasAtom'
|
import { canvasState, currentMenuState } from '@/store/canvasAtom'
|
||||||
import { MENU } from '@/common/common'
|
import { MENU } from '@/common/common'
|
||||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||||
import { usePolygon } from '@/hooks/usePolygon'
|
|
||||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||||
import { corridorDimensionSelector, settingModalFirstOptionsState } from '@/store/settingAtom'
|
import { corridorDimensionSelector } from '@/store/settingAtom'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 메뉴 처리 훅
|
* 메뉴 처리 훅
|
||||||
@ -33,12 +31,13 @@ export default function useMenu() {
|
|||||||
const currentMenu = useRecoilValue(currentMenuState)
|
const currentMenu = useRecoilValue(currentMenuState)
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const [popupId, setPopupId] = useState(uuidv4())
|
const [popupId, setPopupId] = useState(uuidv4())
|
||||||
const { addPopup } = usePopup()
|
const { addPopup, closeAll } = usePopup()
|
||||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
||||||
const { clear: trestleClear, setAllModuleSurfaceIsComplete } = useTrestle()
|
const { clear: trestleClear, setAllModuleSurfaceIsComplete } = useTrestle()
|
||||||
const { nextStep } = useOrientation()
|
const { nextStep } = useOrientation()
|
||||||
const [corridorDimension, setCorridorDimension] = useRecoilState(corridorDimensionSelector)
|
const [corridorDimension, setCorridorDimension] = useRecoilState(corridorDimensionSelector)
|
||||||
const handleMenu = (type) => {
|
const handleMenu = (type) => {
|
||||||
|
closeAll()
|
||||||
if (type === 'outline') {
|
if (type === 'outline') {
|
||||||
// 지붕 덮개 메뉴의 경우는 복도치수로 적용한다.
|
// 지붕 덮개 메뉴의 경우는 복도치수로 적용한다.
|
||||||
setCorridorDimension(0)
|
setCorridorDimension(0)
|
||||||
|
|||||||
@ -311,8 +311,6 @@ export function removeDuplicatePolygons(polygons, hasAuxiliaryLine = false) {
|
|||||||
// return isValidPoints(polygon)
|
// return isValidPoints(polygon)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
console.log('uniquePolygons2', uniquePolygons)
|
|
||||||
|
|
||||||
return uniquePolygons
|
return uniquePolygons
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,6 +371,14 @@ function checkPolygonSelfIntersection(coordinates) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 모든 점이 같은 직선상에 있는지 검사 (degenerate polygon)
|
||||||
|
const allSameX = coordinates.every((point) => point.x === coordinates[0].x)
|
||||||
|
const allSameY = coordinates.every((point) => point.y === coordinates[0].y)
|
||||||
|
|
||||||
|
if (allSameX || allSameY) {
|
||||||
|
return true // 직선상의 점들은 유효하지 않은 다각형이므로 true 반환
|
||||||
|
}
|
||||||
|
|
||||||
const intersections = []
|
const intersections = []
|
||||||
const edges = []
|
const edges = []
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user