문제

ARC 세트에서 원의 크기를 어떻게 계산할 수 있습니까?

특히 나는이 SVG 경로 정의를 가지고 있으며, 원을 끌어 들이고 싶습니다.

<path clip-path="url(#SVGID_2_)" fill="#99C44C" d="M334.293,56.846c0-4.782,3.88-8.659,8.665-8.659c4.78,0,8.66,3.877,8.66,8.659
    c0,4.783-3.88,8.661-8.66,8.661C338.173,65.507,334.293,61.629,334.293,56.846"/>
.

정보의 경우 원은 'D'속성에 그려집니다.M334.293,56.846이 x, y 위치로 이동하면 c 명령은 곡선입니다.

곡선 :

곡선의 끝에있는 제어점으로 (x2, y2)를 사용하여 (x1, y1), 곡선의 끝에있는 제어점으로 (x2, y)를 사용하여 현재 지점으로 (x, y)로부터 큐빅 베네 빙어 곡선을 그립니다....에C (대문자)는 절대 좌표가 따라갈 것임을 나타냅니다.C (소문자)는 상대 좌표가 따라야 함을 나타냅니다.

relative curves
c0-4.782,3.88-8.659,8.665-8.659
c4.78,0,8.66,3.877,8.66,8.659
c0,4.783-3.88,8.661-8.66,8.661

absolute curve
C338.173,65.507,334.293,61.629,334.293,56.846
.

도움이 되었습니까?

해결책

At this juncture you have two possibilites:

You can treat the bezier curve as a circle (which is, as commented, wrong; it's just really circle-looking). To calculate the area, determine the radius and use π * r^2 as usual.

If you want to calculate generally the area enclosed by a path element; that requires some moderate calculus, and is not for the faint of heart.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top