File: topoly.h

package info (click to toggle)
pcb-rnd 3.1.7b-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,108 kB
  • sloc: ansic: 213,400; yacc: 6,241; sh: 4,698; awk: 3,016; makefile: 2,254; lex: 1,166; python: 519; xml: 261; lisp: 154; tcl: 67; perl: 34; javascript: 6; ruby: 5
file content (89 lines) | stat: -rw-r--r-- 3,956 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 *                            COPYRIGHT
 *
 *  pcb-rnd, interactive printed circuit board design
 *  Copyright (C) 2017 Tibor 'Igor2' Palinkas
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *  Contact:
 *    Project page: http://repo.hu/projects/pcb-rnd
 *    lead developer: http://repo.hu/projects/pcb-rnd/contact.html
 *    mailing list: pcb-rnd (at) list.repo.hu (send "subscribe")
 */

#ifndef PCB_TOPOLY_H
#define PCB_TOPOLY_H

#include "board.h"
#include "obj_common.h"
#include <libfungw/fungw.h>

typedef enum pcb_topoly_e {
	PCB_TOPOLY_KEEP_ORIG = 1,   /* keep original objects */
	PCB_TOPOLY_FLOATING = 2     /* do not add the new polygon on any layer */
} pcb_topoly_t;

typedef struct pcb_topoly_cutout_opts_s {
	rnd_coord_t pstk_min_drill_dia;   /* do not export drilled holes smaller than this */
	rnd_coord_t pstk_min_line_thick;
	unsigned pstk_omit_slot_poly:1;   /* do not export polygon shaped slots in padstacks */
	unsigned omit_pstks:1;            /* ignore padstacks */
} pcb_topoly_cutout_opts_t;

/* Convert a loop of connected objects into a polygon (with no holes); the first
   object is named in start. The _with version uses a caller provided dynamic
   flag that is not cleared within the call so multiple loops can be mapped. */
pcb_poly_t *pcb_topoly_conn(pcb_board_t *pcb, pcb_any_obj_t *start, pcb_topoly_t how);
pcb_poly_t *pcb_topoly_conn_with(pcb_board_t *pcb, pcb_any_obj_t *start, pcb_topoly_t how, pcb_dynf_t df);


/* Find the first line/arc on the outline layer from top-left */
pcb_any_obj_t *pcb_topoly_find_1st_outline(pcb_board_t *pcb);

/* Construct a polygon of the first line/arc on the outline layer from
   top-left; if df is not -1, lines and arcs are marked with df. Furthermore
   padstacks with hole/slot that cross the contour of the polygon are marked
   with df (if df is not -1) */
pcb_poly_t *pcb_topoly_1st_outline_with(pcb_board_t *pcb, pcb_topoly_t how, pcb_dynf_t df);

/* Construct a cutout (multi-island) polyarea using boundary lines/arcs and
   padstack holes/slots that are in contour (mapped using
   pcb_topoly_1st_outline_with() before this call) */
rnd_polyarea_t *pcb_topoly_cutouts_in(pcb_board_t *pcb, pcb_dynf_t df, pcb_poly_t *contour, const pcb_topoly_cutout_opts_t *opts);


/* Construct a polygon of the first line/arc on the outline layer from top-left */
pcb_poly_t *pcb_topoly_1st_outline(pcb_board_t *pcb, pcb_topoly_t how);

typedef struct pcb_topoly_solid_opts_s {
	unsigned per_grp:1;            /* export per layer group; subsequent layers in the same group are mapped to the first layer of the group */
	pcb_layer_type_t loc_mask;     /* if not 0, include only layers matching the location part of this */
	pcb_layer_type_t typ_mask;     /* if not 0, include only layers matching the type part of this */
} pcb_topoly_solid_opts_t;


/* Convert all objects that are marked with df into solid polygons and union
   them into polyareas. Returns a vector of polygons, one polygon per layer,
   indexed by layer ID. */
vtp0_t *pcb_topoly_solids_in(pcb_board_t *pcb, pcb_dynf_t df, const pcb_topoly_solid_opts_t *opts);



extern const char pcb_acts_topoly[];
extern const char pcb_acth_topoly[];
fgw_error_t pcb_act_topoly(fgw_arg_t *ores, int oargc, fgw_arg_t *oargv);

#endif