mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Ported contains_line() to XS
This commit is contained in:
		
							parent
							
								
									bd62de7653
								
							
						
					
					
						commit
						a225a8b2ef
					
				
					 10 changed files with 97 additions and 67 deletions
				
			
		| 
						 | 
				
			
			@ -54,13 +54,6 @@ sub encloses_point_quick {
 | 
			
		|||
    return Boost::Geometry::Utils::point_within_polygon($point->pp, $self->pp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub contains_line {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    my ($line) = @_;
 | 
			
		||||
    
 | 
			
		||||
    return @{Slic3r::Geometry::Clipper::diff_pl([$line->as_polyline], \@$self)} ? 0 : 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub bounding_box {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return $self->contour->bounding_box;
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +65,7 @@ sub clip_line {
 | 
			
		|||
    
 | 
			
		||||
    return [
 | 
			
		||||
        map Slic3r::Line->new(@$_),
 | 
			
		||||
            @{Slic3r::Geometry::Clipper::intersection_pl([ Slic3r::Polyline->new(@$line) ], \@$self)}
 | 
			
		||||
            @{Slic3r::Geometry::Clipper::intersection_pl([ $line->as_polyline ], \@$self)}
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue