mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	Fixes for bridges
This commit is contained in:
		
							parent
							
								
									459577f9a2
								
							
						
					
					
						commit
						84abd41cf4
					
				
					 9 changed files with 131 additions and 31 deletions
				
			
		
							
								
								
									
										43
									
								
								t/geometry.t
									
										
									
									
									
								
							
							
						
						
									
										43
									
								
								t/geometry.t
									
										
									
									
									
								
							|  | @ -2,7 +2,7 @@ use Test::More; | |||
| use strict; | ||||
| use warnings; | ||||
| 
 | ||||
| plan tests => 15; | ||||
| plan tests => 17; | ||||
| 
 | ||||
| BEGIN { | ||||
|     use FindBin; | ||||
|  | @ -10,7 +10,9 @@ BEGIN { | |||
| } | ||||
| 
 | ||||
| use Slic3r; | ||||
| use Slic3r::Geometry qw(PI); | ||||
| use Slic3r::Geometry qw(PI polyline_remove_parallel_continuous_edges  | ||||
|     polyline_remove_acute_vertices polygon_remove_acute_vertices | ||||
|     polygon_remove_parallel_continuous_edges); | ||||
| 
 | ||||
| #========================================================== | ||||
| 
 | ||||
|  | @ -114,3 +116,40 @@ is Slic3r::Geometry::can_connect_points(@$points, $polygons), 0, 'can_connect_po | |||
| } | ||||
| 
 | ||||
| #========================================================== | ||||
| 
 | ||||
| { | ||||
|     my $polygon = [ | ||||
|         [2265447881, 7013509857], [2271869937, 7009802077], [2606221146, 6816764300], [1132221146, 4263721402],  | ||||
|         [1098721150, 4205697705], [1228411320, 4130821051], [1557501031, 3940821051], [1737340080, 3836990933],  | ||||
|         [1736886253, 3837252951], [1494771522, 3977037948], [2959638603, 6514262167], [3002271522, 6588104548],  | ||||
|         [3083252364, 6541350240], [2854283608, 6673545411], [2525193897, 6863545411], | ||||
|     ]; | ||||
|     polygon_remove_parallel_continuous_edges($polygon); | ||||
|     polygon_remove_acute_vertices($polygon); | ||||
|     is scalar(@$polygon), 4, 'polygon_remove_acute_vertices'; | ||||
|      | ||||
|     use Slic3r::SVG; | ||||
|     #pop @$polygon; | ||||
|     Slic3r::SVG::output(undef, "vert.svg", | ||||
|         polylines => [$polygon], | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| #========================================================== | ||||
| 
 | ||||
| { | ||||
|     my $polygon = [ | ||||
|         [226.5447881,701.3509857], [260.6221146,681.67643], [109.872115,420.5697705], [149.4771522,397.7037948],  | ||||
|         [300.2271522,658.8104548], [308.3252364,654.135024], | ||||
|     ]; | ||||
|     polyline_remove_acute_vertices($polygon); | ||||
|     is scalar(@$polygon), 6, 'polyline_remove_acute_vertices'; | ||||
|     use Slic3r::SVG; | ||||
|     local $Slic3r::resolution = 0.1; | ||||
|     pop @$polygon; | ||||
|     Slic3r::SVG::output(undef, "vert2.svg", | ||||
|         polylines => [$polygon], | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| #========================================================== | ||||
							
								
								
									
										4
									
								
								t/stl.t
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								t/stl.t
									
										
									
									
									
								
							|  | @ -25,8 +25,8 @@ is_deeply lines(22, 20, 20), [ [ $points[2], $points[1] ] ], 'lower edge on laye | |||
| is_deeply lines(20, 20, 10), [ [ $points[0], $points[1] ] ], 'upper edge on layer'; | ||||
| is_deeply lines(20, 15, 10), [                            ], 'upper vertex on layer'; | ||||
| is_deeply lines(28, 20, 30), [                            ], 'lower vertex on layer'; | ||||
| is_deeply lines(24, 10, 16), [ [ [2, 6],     [4, 4]     ] ], 'two edges intersect'; | ||||
| is_deeply lines(24, 10, 20), [ [ [1, 9],     [4, 4]     ] ], 'one vertex on plane and one edge intersects'; | ||||
| is_deeply lines(24, 10, 16), [ [ [4, 4],     [2, 6]     ] ], 'two edges intersect'; | ||||
| is_deeply lines(24, 10, 20), [ [ [4, 4],     [1, 9]     ] ], 'one vertex on plane and one edge intersects'; | ||||
| 
 | ||||
| my @lower = $stl->intersect_facet(vertices(22, 20, 20), $z, $dz); | ||||
| my @upper = $stl->intersect_facet(vertices(20, 20, 10), $z, $dz); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci