当前位置: 首页>>代码示例>>Java>>正文


Java Line.opposite方法代码示例

本文整理汇总了Java中geometry.planar.Line.opposite方法的典型用法代码示例。如果您正苦于以下问题:Java Line.opposite方法的具体用法?Java Line.opposite怎么用?Java Line.opposite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在geometry.planar.Line的用法示例。


在下文中一共展示了Line.opposite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calc_cutline_at_end

import geometry.planar.Line; //导入方法依赖的package包/类
private static Line calc_cutline_at_end(int p_index, PolylineTrace p_trace)
{
    Polyline trace_lines = p_trace.polyline();
    ShapeSearchTree search_tree = p_trace.board.search_tree_manager.get_default_tree();
    if (p_index == trace_lines.arr.length - 3 ||
            trace_lines.corner_approx(trace_lines.arr.length - 2).distance(trace_lines.corner_approx(p_index + 1))
            < p_trace.get_compensated_half_width(search_tree))
    {
        
        Line curr_line = trace_lines.arr[trace_lines.arr.length - 1];
        FloatPoint is = trace_lines.corner_approx(trace_lines.arr.length - 3);
        Line cut_line;
        if (curr_line.side_of(is) == Side.ON_THE_LEFT)
        {
            cut_line = curr_line.opposite();
        }
        else
        {
            cut_line = curr_line;
        }
        return cut_line;
    }
    return null;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:25,代码来源:CalcShapeAndFromSide.java

示例2: calc_cutline_at_start

import geometry.planar.Line; //导入方法依赖的package包/类
private static Line calc_cutline_at_start(int p_index, PolylineTrace p_trace)
{
    Polyline trace_lines = p_trace.polyline();
    ShapeSearchTree search_tree = p_trace.board.search_tree_manager.get_default_tree();
    if (p_index == 0 ||
            trace_lines.corner_approx(0).distance(trace_lines.corner_approx(p_index))
            < p_trace.get_compensated_half_width(search_tree))
    {
        Line curr_line = trace_lines.arr[0];
        FloatPoint is = trace_lines.corner_approx(1);
        Line cut_line;
        if (curr_line.side_of(is) == Side.ON_THE_LEFT)
        {
            cut_line = curr_line.opposite();
        }
        else
        {
            cut_line = curr_line;
        }
        return cut_line;
    }
    return null;
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:24,代码来源:CalcShapeAndFromSide.java

示例3: calculate_incomplete_rooms_with_empty_neighbours

import geometry.planar.Line; //导入方法依赖的package包/类
private static void calculate_incomplete_rooms_with_empty_neighbours(ObstacleExpansionRoom p_room, AutorouteEngine p_autoroute_engine)
{
    TileShape room_shape = p_room.get_shape();
    for (int i = 0; i < room_shape.border_line_count(); ++i)
    {
        Line curr_line = room_shape.border_line(i);
        if (SortedRoomNeighbours.insert_door_ok(p_room, curr_line))
        {
            Line[] shape_line = new Line[1];
            shape_line[0] = curr_line.opposite();
            TileShape new_room_shape = new Simplex(shape_line);
            TileShape new_contained_shape = room_shape.intersection(new_room_shape);
            FreeSpaceExpansionRoom new_room = p_autoroute_engine.add_incomplete_expansion_room(new_room_shape, p_room.get_layer(), new_contained_shape);
            ExpansionDoor new_door = new ExpansionDoor(p_room, new_room, 1);
            p_room.add_door(new_door);
            new_room.add_door(new_door);
        }
    }
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:20,代码来源:SortedRoomNeighbours.java


注:本文中的geometry.planar.Line.opposite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。