@@ -52,6 +52,11 @@ rightTriangle.moveTo(1, 1);
5252rightTriangle . lineTo ( 1 , - 1 ) ;
5353rightTriangle . lineTo ( - 1 , 1 ) ;
5454
55+ const rightTriangle2 = new Shape ( ) ;
56+ rightTriangle2 . moveTo ( 1 , 1 ) ;
57+ rightTriangle2 . lineTo ( - 1 , 1 ) ;
58+ rightTriangle2 . lineTo ( 1 , - 1 ) ;
59+
5560test ( 'Extents no Rotation' , ( ) => {
5661 expect ( BuildingShapeUtils . extents ( rightTriangle ) ) . toStrictEqual ( [ - 1 , - 1 , 1 , 1 ] ) ;
5762} ) ;
@@ -67,7 +72,11 @@ test('Edge Lengths', () => {
6772} ) ;
6873
6974test ( 'Edge Direction' , ( ) => {
70- expect ( BuildingShapeUtils . edgeDirection ( rightTriangle ) ) . toBeDeepCloseTo ( [ - Math . PI / 2 , - Math . PI / 4 , 0 ] ) ;
75+ expect ( BuildingShapeUtils . edgeDirection ( rightTriangle ) ) . toBeDeepCloseTo ( [ - Math . PI / 2 , Math . PI / 4 , 0 ] ) ;
76+ } ) ;
77+
78+ test ( 'Edge Direction' , ( ) => {
79+ expect ( BuildingShapeUtils . edgeDirection ( rightTriangle2 ) ) . toBeDeepCloseTo ( [ Math . PI , - Math . PI / 4 , Math . PI / 2 ] ) ;
7180} ) ;
7281
7382test ( 'Longest side angle' , ( ) => {
@@ -101,10 +110,6 @@ test('Vertex Angles', () => {
101110 expect ( BuildingShapeUtils . vertexAngle ( rightTriangle ) ) . toStrictEqual ( [ Math . PI / 2 , Math . PI / 4 , Math . PI / 4 ] ) ;
102111} ) ;
103112
104- const rightTriangle2 = new Shape ( ) ;
105- rightTriangle2 . moveTo ( 1 , 1 ) ;
106- rightTriangle2 . lineTo ( - 1 , 1 ) ;
107- rightTriangle2 . lineTo ( 1 , - 1 ) ;
108113test ( 'Vertex Angles counterclockwise' , ( ) => {
109114 expect ( BuildingShapeUtils . vertexAngle ( rightTriangle2 ) ) . toStrictEqual ( [ - Math . PI / 2 , - Math . PI / 4 , - Math . PI / 4 ] ) ;
110115} ) ;
0 commit comments