@@ -61,3 +61,54 @@ def test_chamfer(modeler: Modeler):
6161 assert body2 .volume .m == pytest .approx (
6262 Quantity (0.945333333333333333 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
6363 )
64+
65+
66+ def test_fillet (modeler : Modeler ):
67+ """Test fillet on edge and face."""
68+ design = modeler .create_design ("chamfer" )
69+
70+ body = design .extrude_sketch ("box" , Sketch ().box (Point2D ([0 , 0 ]), 1 , 1 ), 1 )
71+ assert len (body .faces ) == 6
72+ assert len (body .edges ) == 12
73+ assert body .volume .m == pytest .approx (Quantity (1 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8 )
74+
75+ modeler .pull_tools .fillet (body .edges [0 ], 0.1 )
76+ assert len (body .faces ) == 7
77+ assert len (body .edges ) == 15
78+ assert body .volume .m == pytest .approx (
79+ Quantity (0.9978539816339744 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
80+ )
81+
82+ modeler .pull_tools .fillet (body .faces [- 1 ], 0.5 )
83+ assert len (body .faces ) == 7
84+ assert len (body .edges ) == 15
85+ assert body .volume .m == pytest .approx (
86+ Quantity (0.946349540849362 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
87+ )
88+
89+ # multiple edges
90+ body2 = design .extrude_sketch ("box2" , Sketch ().box (Point2D ([0 , 0 ]), 1 , 1 ), 1 )
91+ assert len (body2 .faces ) == 6
92+ assert len (body2 .edges ) == 12
93+ assert body2 .volume .m == pytest .approx (Quantity (1 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8 )
94+
95+ modeler .pull_tools .fillet (body2 .edges , 0.1 )
96+ assert len (body2 .faces ) == 26
97+ assert len (body2 .edges ) == 48
98+ assert body2 .volume .m == pytest .approx (
99+ Quantity (0.9755870138909422 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
100+ )
101+
102+ modeler .pull_tools .fillet (body2 .faces , 0.3 )
103+ assert len (body2 .faces ) == 26
104+ assert len (body2 .edges ) == 48
105+ assert body2 .volume .m == pytest .approx (
106+ Quantity (0.8043893421169303 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
107+ )
108+
109+ modeler .pull_tools .fillet (body2 .faces , 0.05 )
110+ assert len (body2 .faces ) == 26
111+ assert len (body2 .edges ) == 48
112+ assert body2 .volume .m == pytest .approx (
113+ Quantity (0.9937293491873294 , UNITS .m ** 3 ).m , rel = 1e-6 , abs = 1e-8
114+ )
0 commit comments