Example #1
0
 /** Inserts a component ouline into the board. */
 public ComponentOutline insert_component_outline(
     Area p_area,
     boolean p_is_front,
     Vector p_translation,
     double p_rotation_in_degree,
     int p_component_no,
     FixedState p_fixed_state) {
   if (p_area == null) {
     System.out.println("BasicBoard.insert_component_outline: p_area is null");
     return null;
   }
   if (!p_area.is_bounded()) {
     System.out.println("BasicBoard.insert_component_outline: p_area is not bounded");
     return null;
   }
   ComponentOutline outline =
       new ComponentOutline(
           p_area,
           p_is_front,
           p_translation,
           p_rotation_in_degree,
           p_component_no,
           p_fixed_state,
           this);
   insert_item(outline);
   return outline;
 }
Example #2
0
 /**
  * Inserts a trace into the board, whose geometry is described by a Polyline. p_clearance_class is
  * the index in the clearance_matix, which describes the required clearance restrictions to other
  * items. Because no internal cleaning of items is done, the new inserted item can be returned.
  */
 public PolylineTrace insert_trace_without_cleaning(
     Polyline p_polyline,
     int p_layer,
     int p_half_width,
     int[] p_net_no_arr,
     int p_clearance_class,
     FixedState p_fixed_state) {
   if (p_polyline.corner_count() < 2) {
     return null;
   }
   PolylineTrace new_trace =
       new PolylineTrace(
           p_polyline,
           p_layer,
           p_half_width,
           p_net_no_arr,
           p_clearance_class,
           0,
           0,
           p_fixed_state,
           this);
   if (new_trace.first_corner().equals(new_trace.last_corner())) {
     if (p_fixed_state.ordinal() < FixedState.USER_FIXED.ordinal()) {
       return null;
     }
   }
   insert_item(new_trace);
   if (new_trace.nets_normal()) {
     max_trace_half_width = Math.max(max_trace_half_width, p_half_width);
     min_trace_half_width = Math.min(min_trace_half_width, p_half_width);
   }
   return new_trace;
 }
Example #3
0
 /**
  * Inserts a condution area into the board , whose geometry is described by a polygonyal shape,
  * which may have holes. If p_is_obstacle is false, it is possible to route through the conduction
  * area with traces and vias of foreign nets.
  */
 public ConductionArea insert_conduction_area(
     Area p_area,
     int p_layer,
     int[] p_net_no_arr,
     int p_clearance_class,
     boolean p_is_obstacle,
     FixedState p_fixed_state) {
   if (p_area == null) {
     System.out.println("BasicBoard.insert_conduction_area: p_area is null");
     return null;
   }
   ConductionArea c =
       new ConductionArea(
           p_area,
           p_layer,
           Vector.ZERO,
           0,
           false,
           p_net_no_arr,
           p_clearance_class,
           0,
           0,
           null,
           p_is_obstacle,
           p_fixed_state,
           this);
   insert_item(c);
   return c;
 }
Example #4
0
 /**
  * Inserts a component obstacle belonging to a component into the board. p_name is to identify the
  * corresponding ObstacstacleArea in the component package.
  */
 public ComponentObstacleArea insert_component_obstacle(
     Area p_area,
     int p_layer,
     Vector p_translation,
     double p_rotation_in_degree,
     boolean p_side_changed,
     int p_clearance_class,
     int p_component_no,
     String p_name,
     FixedState p_fixed_state) {
   if (p_area == null) {
     System.out.println("BasicBoard.insert_component_obstacle: p_area is null");
     return null;
   }
   ComponentObstacleArea obs =
       new ComponentObstacleArea(
           p_area,
           p_layer,
           p_translation,
           p_rotation_in_degree,
           p_side_changed,
           p_clearance_class,
           0,
           p_component_no,
           p_name,
           p_fixed_state,
           this);
   insert_item(obs);
   return obs;
 }
Example #5
0
 /**
  * Inserts a via into the board. p_attach_allowed indicates, if the via may overlap with smd pins
  * of the same net.
  */
 public Via insert_via(
     Padstack p_padstack,
     Point p_center,
     int[] p_net_no_arr,
     int p_clearance_class,
     FixedState p_fixed_state,
     boolean p_attach_allowed) {
   Via new_via =
       new Via(
           p_padstack,
           p_center,
           p_net_no_arr,
           p_clearance_class,
           0,
           0,
           p_fixed_state,
           p_attach_allowed,
           this);
   insert_item(new_via);
   int from_layer = p_padstack.from_layer();
   int to_layer = p_padstack.to_layer();
   for (int i = from_layer; i < to_layer; ++i) {
     for (int curr_net_no : p_net_no_arr) {
       split_traces(p_center, i, curr_net_no);
     }
   }
   return new_via;
 }
Example #6
0
 /**
  * Turns an obstacle area into a conduction area with net number p_net_no If it is convex and has
  * no holes, it is turned into a Pin, alse into a conduction area.
  */
 public Connectable make_conductive(ObstacleArea p_area, int p_net_no) {
   Item new_item;
   Area curr_area = p_area.get_relative_area();
   int layer = p_area.get_layer();
   FixedState fixed_state = p_area.get_fixed_state();
   Vector translation = p_area.get_translation();
   double rotation = p_area.get_rotation_in_degree();
   boolean side_changed = p_area.get_side_changed();
   int[] net_no_arr = new int[1];
   net_no_arr[0] = p_net_no;
   new_item =
       new ConductionArea(
           curr_area,
           layer,
           translation,
           rotation,
           side_changed,
           net_no_arr,
           p_area.clearance_class_no(),
           0,
           p_area.get_component_no(),
           p_area.name,
           true,
           fixed_state,
           this);
   remove_item(p_area);
   insert_item(new_item);
   return (Connectable) new_item;
 }
Example #7
0
 /**
  * Inserts a pin into the board. p_pin_no is the number of this pin in the library package of its
  * component (starting with 0).
  */
 public Pin insert_pin(
     int p_component_no,
     int p_pin_no,
     int[] p_net_no_arr,
     int p_clearance_class,
     FixedState p_fixed_state) {
   Pin new_pin =
       new Pin(p_component_no, p_pin_no, p_net_no_arr, p_clearance_class, 0, p_fixed_state, this);
   insert_item(new_pin);
   return new_pin;
 }
Example #8
0
 /**
  * Inserts a component obstacle area into the board , whose geometry is described by a polygonyal
  * shape, which may have holes.
  */
 public ComponentObstacleArea insert_component_obstacle(
     Area p_area, int p_layer, int p_clearance_class, FixedState p_fixed_state) {
   if (p_area == null) {
     System.out.println("BasicBoard.insert_component_obstacle: p_area is null");
     return null;
   }
   ComponentObstacleArea obs =
       new ComponentObstacleArea(
           p_area,
           p_layer,
           Vector.ZERO,
           0,
           false,
           p_clearance_class,
           0,
           0,
           null,
           p_fixed_state,
           this);
   insert_item(obs);
   return obs;
 }
Example #9
0
 /** Inserts an Outline into the board. */
 public BoardOutline insert_outline(PolylineShape[] p_outline_shapes, int p_clearance_class_no) {
   BoardOutline result = new BoardOutline(p_outline_shapes, p_clearance_class_no, 0, this);
   insert_item(result);
   return result;
 }