BRL-CAD
brep.c
Go to the documentation of this file.
1 /* B R E P . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2008-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file libged/brep.c
21  *
22  * The brep command.
23  *
24  */
25 
26 #include "common.h"
27 
28 #include <stdlib.h>
29 #include <string.h>
30 
31 
32 #include "raytrace.h"
33 #include "rtgeom.h"
34 #include "wdb.h"
35 
36 #include "./ged_private.h"
37 
38 /* TODO - get rid of the need for brep_specific at this level */
39 #include "../librt/primitives/brep/brep_local.h"
40 
41 /* FIXME: how should we set up brep functionality without introducing
42  * lots of new public librt functions? right now, we reach into librt
43  * directly and export what we need from brep_debug.cpp which sucks.
44  */
45 RT_EXPORT extern int brep_command(struct bu_vls *vls, const char *solid_name, const struct rt_tess_tol *ttol, const struct bn_tol *tol, struct brep_specific* bs, struct rt_brep_internal* bi, struct bn_vlblock *vbp, int argc, const char *argv[], char *commtag);
46 RT_EXPORT extern int brep_conversion(struct rt_db_internal* in, struct rt_db_internal* out, const struct db_i *dbip);
47 RT_EXPORT extern int brep_conversion_comb(struct rt_db_internal *old_internal, const char *name, const char *suffix, struct rt_wdb *wdbp, fastf_t local2mm);
48 RT_EXPORT extern int brep_intersect_point_point(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j);
49 RT_EXPORT extern int brep_intersect_point_curve(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j);
50 RT_EXPORT extern int brep_intersect_point_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j);
51 RT_EXPORT extern int brep_intersect_curve_curve(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j);
52 RT_EXPORT extern int brep_intersect_curve_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j);
53 RT_EXPORT extern int brep_intersect_surface_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j, struct bn_vlblock *vbp);
54 RT_EXPORT extern int rt_brep_boolean(struct rt_db_internal *out, const struct rt_db_internal *ip1, const struct rt_db_internal *ip2, db_op_t operation);
55 
56 static int
57 selection_command(
58  struct ged *gedp,
59  struct rt_db_internal *ip,
60  int argc,
61  const char *argv[])
62 {
63  int i;
64  struct rt_selection_set *selection_set;
65  struct bu_ptbl *selections;
66  struct rt_selection *new_selection;
67  struct rt_selection_query query;
68  const char *cmd, *solid_name, *selection_name;
69 
70  /* 0 1 2 3
71  * brep <solid_name> selection subcommand
72  */
73  if (argc < 4) {
74  return -1;
75  }
76 
77  solid_name = argv[1];
78  cmd = argv[3];
79 
80  if (BU_STR_EQUAL(cmd, "append")) {
81  /* append to named selection - selection is created if it doesn't exist */
82  void (*free_selection)(struct rt_selection *);
83 
84  /* 4 5 6 7 8 9 10
85  * selection_name startx starty startz dirx diry dirz
86  */
87  if (argc != 11) {
88  bu_log("wrong args for selection append");
89  return -1;
90  }
91  selection_name = argv[4];
92 
93  /* find matching selections */
94  query.start[X] = atof(argv[5]);
95  query.start[Y] = atof(argv[6]);
96  query.start[Z] = atof(argv[7]);
97  query.dir[X] = atof(argv[8]);
98  query.dir[Y] = atof(argv[9]);
99  query.dir[Z] = atof(argv[10]);
100  query.sorting = RT_SORT_CLOSEST_TO_START;
101 
102  selection_set = ip->idb_meth->ft_find_selections(ip, &query);
103  if (!selection_set) {
104  bu_log("no matching selections");
105  return -1;
106  }
107 
108  /* could be multiple options, just grabbing the first and
109  * freeing the rest
110  */
111  selections = &selection_set->selections;
112  new_selection = (struct rt_selection *)BU_PTBL_GET(selections, 0);
113 
114  free_selection = selection_set->free_selection;
115  for (i = BU_PTBL_LEN(selections) - 1; i > 0; --i) {
116  long *s = BU_PTBL_GET(selections, i);
117  free_selection((struct rt_selection *)s);
118  bu_ptbl_rm(selections, s);
119  }
120  bu_ptbl_free(selections);
121  BU_FREE(selection_set, struct rt_selection_set);
122 
123  /* get existing/new selections set in gedp */
124  selection_set = ged_get_selection_set(gedp, solid_name, selection_name);
125  selection_set->free_selection = free_selection;
126  selections = &selection_set->selections;
127 
128  /* TODO: Need to implement append by passing new and
129  * existing selection to an rt_brep_evaluate_selection.
130  * For now, new selection simply replaces old one.
131  */
132  for (i = BU_PTBL_LEN(selections) - 1; i >= 0; --i) {
133  long *s = BU_PTBL_GET(selections, i);
134  free_selection((struct rt_selection *)s);
135  bu_ptbl_rm(selections, s);
136  }
137  bu_ptbl_ins(selections, (long *)new_selection);
138  } else if (BU_STR_EQUAL(cmd, "translate")) {
139  struct rt_selection_operation operation;
140 
141  /* 4 5 6 7
142  * selection_name dx dy dz
143  */
144  if (argc != 8) {
145  return -1;
146  }
147  selection_name = argv[4];
148 
149  selection_set = ged_get_selection_set(gedp, solid_name, selection_name);
150  selections = &selection_set->selections;
151 
152  if (BU_PTBL_LEN(selections) < 1) {
153  return -1;
154  }
155 
156  for (i = 0; i < (int)BU_PTBL_LEN(selections); ++i) {
157  int ret;
158  operation.type = RT_SELECTION_TRANSLATION;
159  operation.parameters.tran.dx = atof(argv[5]);
160  operation.parameters.tran.dy = atof(argv[6]);
161  operation.parameters.tran.dz = atof(argv[7]);
162 
163  ret = ip->idb_meth->ft_process_selection(ip, gedp->ged_wdbp->dbip,
164  (struct rt_selection *)BU_PTBL_GET(selections, i), &operation);
165 
166  if (ret != 0) {
167  return ret;
168  }
169  }
170  }
171 
172  return 0;
173 }
174 
175 int
176 ged_brep(struct ged *gedp, int argc, const char *argv[])
177 {
178  struct bn_vlblock*vbp;
179  const char *solid_name;
180  static const char *usage = "brep <obj> [command|brepname|suffix] ";
181  struct directory *ndp;
182  struct rt_db_internal intern;
183  struct rt_brep_internal* bi;
184  struct brep_specific* bs;
185  struct soltab *stp;
186  char commtag[64];
187  char namebuf[64];
188  int i, j, real_flag, valid_command, ret;
189  const char *commands[] = {"info", "plot", "translate", "intersect", "u", "i", "-"};
190  int num_commands = (int)(sizeof(commands) / sizeof(const char *));
191  db_op_t op = DB_OP_NULL;
192 
195  GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR);
196 
197  /* initialize result */
198  bu_vls_trunc(gedp->ged_result_str, 0);
199 
200  /* must be wanting help */
201  if (argc < 2) {
202  bu_vls_printf(gedp->ged_result_str, "Usage: %s\n\t%s\n", argv[0], usage);
203  bu_vls_printf(gedp->ged_result_str, "commands:\n");
204  bu_vls_printf(gedp->ged_result_str, "\tinfo - return count information for specific BREP\n");
205  bu_vls_printf(gedp->ged_result_str, "\tinfo S [index] - return information for specific BREP 'surface'\n");
206  bu_vls_printf(gedp->ged_result_str, "\tinfo F [index] - return information for specific BREP 'face'\n");
207  bu_vls_printf(gedp->ged_result_str, "\tplot - plot entire BREP\n");
208  bu_vls_printf(gedp->ged_result_str, "\tplot S [index] - plot specific BREP 'surface'\n");
209  bu_vls_printf(gedp->ged_result_str, "\tplot F [index] - plot specific BREP 'face'\n");
210  bu_vls_printf(gedp->ged_result_str, "\ttranslate SCV index i j dx dy dz - translate a surface control vertex\n");
211  bu_vls_printf(gedp->ged_result_str, "\tintersect <obj2> <i> <j> [PP|PC|PS|CC|CS|SS] - BREP intersections\n");
212  bu_vls_printf(gedp->ged_result_str, "\tu|i|- <obj2> <output> - BREP boolean evaluations\n");
213  bu_vls_printf(gedp->ged_result_str, "\t[brepname] - convert the non-BREP object to BREP form\n");
214  bu_vls_printf(gedp->ged_result_str, "\t --no-evaluation [suffix] - convert non-BREP comb to unevaluated BREP form\n");
215  return GED_HELP;
216  }
217 
218  if (argc < 2 || argc > 11) {
219  bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
220  return GED_ERROR;
221  }
222 
223  solid_name = argv[1];
224  if ((ndp = db_lookup(gedp->ged_wdbp->dbip, solid_name, LOOKUP_NOISY)) == RT_DIR_NULL) {
225  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a solid or does not exist in database", solid_name);
226  return GED_ERROR;
227  } else {
228  real_flag = (ndp->d_addr == RT_DIR_PHONY_ADDR) ? 0 : 1;
229  }
230 
231  if (!real_flag) {
232  /* solid doesn't exist - don't kill */
233  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a real solid", solid_name);
234  return GED_OK;
235  }
236 
238 
239 
240  RT_CK_DB_INTERNAL(&intern);
241  bi = (struct rt_brep_internal*)intern.idb_ptr;
242 
243  if (BU_STR_EQUAL(argv[2], "intersect")) {
244  /* handle surface-surface intersection */
245  struct rt_db_internal intern2;
246 
247  /* we need exactly 6 or 7 arguments */
248  if (argc != 6 && argc != 7) {
249  bu_vls_printf(gedp->ged_result_str, "There should be 6 or 7 arguments for intersection.\n");
250  bu_vls_printf(gedp->ged_result_str, "See the usage for help.\n");
251  return GED_ERROR;
252  }
253 
254  /* get the other solid */
255  if ((ndp = db_lookup(gedp->ged_wdbp->dbip, argv[3], LOOKUP_NOISY)) == RT_DIR_NULL) {
256  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a solid or does not exist in database", argv[3]);
257  return GED_ERROR;
258  } else {
259  real_flag = (ndp->d_addr == RT_DIR_PHONY_ADDR) ? 0 : 1;
260  }
261 
262  if (!real_flag) {
263  /* solid doesn't exist - don't kill */
264  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a real solid", argv[3]);
265  return GED_OK;
266  }
267 
269 
270  i = atoi(argv[4]);
271  j = atoi(argv[5]);
272  vbp = rt_vlblock_init();
273 
274  if (argc == 6 || BU_STR_EQUAL(argv[6], "SS")) {
275  brep_intersect_surface_surface(&intern, &intern2, i, j, vbp);
276  } else if (BU_STR_EQUAL(argv[6], "PP")) {
277  brep_intersect_point_point(&intern, &intern2, i, j);
278  } else if (BU_STR_EQUAL(argv[6], "PC")) {
279  brep_intersect_point_curve(&intern, &intern2, i, j);
280  } else if (BU_STR_EQUAL(argv[6], "PS")) {
281  brep_intersect_point_surface(&intern, &intern2, i, j);
282  } else if (BU_STR_EQUAL(argv[6], "CC")) {
283  brep_intersect_curve_curve(&intern, &intern2, i, j);
284  } else if (BU_STR_EQUAL(argv[6], "CS")) {
285  brep_intersect_curve_surface(&intern, &intern2, i, j);
286  } else {
287  bu_vls_printf(gedp->ged_result_str, "Invalid intersection type %s.\n", argv[6]);
288  }
289 
290  _ged_cvt_vlblock_to_solids(gedp, vbp, namebuf, 0);
291  rt_vlblock_free(vbp);
292  vbp = (struct bn_vlblock *)NULL;
293 
294  rt_db_free_internal(&intern);
295  rt_db_free_internal(&intern2);
296  return GED_OK;
297  }
298 
299  /* make sure arg isn't --no-evaluate */
300  if (argc > 2 && argv[2][1] != '-') {
301  op = db_str2op(argv[2]);
302  }
303 
304  if (op != DB_OP_NULL) {
305  /* test booleans on brep.
306  * u: union, i: intersect, -: diff, x: xor
307  */
308  struct rt_db_internal intern2, intern_res;
309  struct rt_brep_internal *bip;
310 
311  if (argc != 5) {
312  bu_vls_printf(gedp->ged_result_str, "Error: There should be exactly 5 params.\n");
313  return GED_ERROR;
314  }
315 
316  /* get the other solid */
317  if ((ndp = db_lookup(gedp->ged_wdbp->dbip, argv[3], LOOKUP_NOISY)) == RT_DIR_NULL) {
318  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a solid or does not exist in database", argv[3]);
319  return GED_ERROR;
320  } else {
321  real_flag = (ndp->d_addr == RT_DIR_PHONY_ADDR) ? 0 : 1;
322  }
323 
324  if (!real_flag) {
325  /* solid doesn't exist - don't kill */
326  bu_vls_printf(gedp->ged_result_str, "Error: %s is not a real solid", argv[3]);
327  return GED_OK;
328  }
329 
331 
332  rt_brep_boolean(&intern_res, &intern, &intern2, op);
333  bip = (struct rt_brep_internal*)intern_res.idb_ptr;
334  mk_brep(gedp->ged_wdbp, argv[4], bip->brep);
335  rt_db_free_internal(&intern);
336  rt_db_free_internal(&intern2);
337  rt_db_free_internal(&intern_res);
338  return GED_OK;
339  }
340 
341  if (BU_STR_EQUAL(argv[2], "selection")) {
342  ret = selection_command(gedp, &intern, argc, argv);
343  if (BU_STR_EQUAL(argv[3], "translate") && ret == 0) {
344  GED_DB_PUT_INTERNAL(gedp, ndp, &intern, &rt_uniresource, GED_ERROR);
345  }
346  rt_db_free_internal(&intern);
347 
348  return ret;
349  }
350 
351  if (!RT_BREP_TEST_MAGIC(bi)) {
352  /* The solid is not in brep form. Covert it to brep. */
353 
354  struct bu_vls bname, suffix;
355  int no_evaluation = 0;
356 
357  bu_vls_init(&bname);
358  bu_vls_init(&suffix);
359 
360  if (argc == 2) {
361  /* brep obj */
362  bu_vls_sprintf(&bname, "%s_brep", solid_name);
363  bu_vls_sprintf(&suffix, "_brep");
364  } else if (BU_STR_EQUAL(argv[2], "--no-evaluation")) {
365  no_evaluation = 1;
366  if (argc == 3) {
367  /* brep obj --no-evaluation */
368  bu_vls_sprintf(&bname, "%s_brep", solid_name);
369  bu_vls_sprintf(&suffix, "_brep");
370  } else if (argc == 4) {
371  /* brep obj --no-evaluation suffix */
372  bu_vls_sprintf(&bname, argv[3]);
373  bu_vls_sprintf(&suffix, argv[3]);
374  }
375  } else {
376  /* brep obj brepname/suffix */
377  bu_vls_sprintf(&bname, argv[2]);
378  bu_vls_sprintf(&suffix, argv[2]);
379  }
380 
381  if (no_evaluation && intern.idb_type == ID_COMBINATION) {
382  struct bu_vls bname_suffix;
383  bu_vls_init(&bname_suffix);
384  bu_vls_sprintf(&bname_suffix, "%s%s", solid_name, bu_vls_addr(&suffix));
385  if (db_lookup(gedp->ged_wdbp->dbip, bu_vls_addr(&bname_suffix), LOOKUP_QUIET) != RT_DIR_NULL) {
386  bu_vls_printf(gedp->ged_result_str, "%s already exists.", bu_vls_addr(&bname_suffix));
387  bu_vls_free(&bname);
388  bu_vls_free(&suffix);
389  bu_vls_free(&bname_suffix);
390  return GED_OK;
391  }
392  brep_conversion_comb(&intern, bu_vls_addr(&bname_suffix), bu_vls_addr(&suffix), gedp->ged_wdbp, mk_conv2mm);
393  bu_vls_free(&bname_suffix);
394  } else {
395  struct rt_db_internal brep_db_internal;
396  ON_Brep* brep;
397  if (db_lookup(gedp->ged_wdbp->dbip, bu_vls_addr(&bname), LOOKUP_QUIET) != RT_DIR_NULL) {
398  bu_vls_printf(gedp->ged_result_str, "%s already exists.", bu_vls_addr(&bname));
399  bu_vls_free(&bname);
400  bu_vls_free(&suffix);
401  return GED_OK;
402  }
403  ret = brep_conversion(&intern, &brep_db_internal, gedp->ged_wdbp->dbip);
404  if (ret == -1) {
405  bu_vls_printf(gedp->ged_result_str, "%s doesn't have a "
406  "brep-conversion function yet. Type: %s", solid_name,
407  intern.idb_meth->ft_label);
408  } else if (ret == -2) {
409  bu_vls_printf(gedp->ged_result_str, "%s cannot be converted "
410  "to brep correctly.", solid_name);
411  } else {
412  brep = ((struct rt_brep_internal *)brep_db_internal.idb_ptr)->brep;
413  ret = mk_brep(gedp->ged_wdbp, bu_vls_addr(&bname), brep);
414  if (ret == 0) {
415  bu_vls_printf(gedp->ged_result_str, "%s is made.", bu_vls_addr(&bname));
416  }
417  rt_db_free_internal(&brep_db_internal);
418  }
419  }
420  bu_vls_free(&bname);
421  bu_vls_free(&suffix);
422  rt_db_free_internal(&intern);
423  return GED_OK;
424  }
425 
426  BU_ALLOC(stp, struct soltab);
427 
428  if (argc == 2) {
429  bu_vls_printf(gedp->ged_result_str, "Usage: %s %s\n", argv[0], usage);
430  bu_vls_printf(gedp->ged_result_str, "\t%s is in brep form, please input a command.", solid_name);
431  return GED_HELP;
432  }
433 
434  valid_command = 0;
435  for (i = 0; i < num_commands; ++i) {
436  if (BU_STR_EQUAL(argv[2], commands[i])) {
437  valid_command = 1;
438  break;
439  }
440  }
441 
442  if (!valid_command) {
443  bu_vls_printf(gedp->ged_result_str, "Usage: %s %s\n", argv[0], usage);
444  bu_vls_printf(gedp->ged_result_str, "\t%s is in brep form, please input a command.", solid_name);
445  return GED_HELP;
446  }
447 
448  if ((bs = (struct brep_specific*)stp->st_specific) == NULL) {
449  BU_ALLOC(bs, struct brep_specific);
450  bs->brep = bi->brep;
451  bi->brep = NULL;
452  stp->st_specific = (void *)bs;
453  }
454 
455  vbp = rt_vlblock_init();
456 
457  brep_command(gedp->ged_result_str, solid_name, (const struct rt_tess_tol *)&gedp->ged_wdbp->wdb_ttol, &gedp->ged_wdbp->wdb_tol, bs, bi, vbp, argc, argv, commtag);
458 
459  if (BU_STR_EQUAL(argv[2], "translate")) {
460  bi->brep = bs->brep;
461  GED_DB_PUT_INTERNAL(gedp, ndp, &intern, &rt_uniresource, GED_ERROR);
462  }
463 
464  snprintf(namebuf, 64, "%s%s_", commtag, solid_name);
465  _ged_cvt_vlblock_to_solids(gedp, vbp, namebuf, 0);
466  rt_vlblock_free(vbp);
467  vbp = (struct bn_vlblock *)NULL;
468 
469  rt_db_free_internal(&intern);
470 
471  return GED_OK;
472 }
473 
474 
475 /*
476  * Local Variables:
477  * tab-width: 8
478  * mode: C
479  * indent-tabs-mode: t
480  * c-file-style: "stroustrup"
481  * End:
482  * ex: shiftwidth=4 tabstop=8
483  */
void usage(struct ged *gedp)
Definition: coil.c:315
void bu_vls_init(struct bu_vls *vp)
Definition: vls.c:56
#define GED_OK
Definition: ged.h:55
Definition: raytrace.h:800
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
void rt_vlblock_free(struct bn_vlblock *vbp)
Definition: vlist.c:78
int rt_brep_boolean(struct rt_db_internal *out, const struct rt_db_internal *ip1, const struct rt_db_internal *ip2, db_op_t operation)
Definition: brep.cpp:4859
Definition: ged.h:338
const mat_t bn_mat_identity
Matrix and vector functionality.
Definition: mat.c:46
int brep_command(struct bu_vls *vls, const char *solid_name, const struct rt_tess_tol *ttol, const struct bn_tol *tol, struct brep_specific *bs, struct rt_brep_internal *bi, struct bn_vlblock *vbp, int argc, const char *argv[], char *commtag)
struct db_i * dbip
Definition: raytrace.h:1266
if lu s
Definition: nmg_mod.c:3860
Definition: clone.c:90
int(* ft_process_selection)(struct rt_db_internal *, struct db_i *, const struct rt_selection *, const struct rt_selection_operation *)
Definition: raytrace.h:2231
void bu_vls_trunc(struct bu_vls *vp, int len)
Definition: vls.c:198
#define GED_CHECK_ARGC_GT_0(_gedp, _argc, _flags)
Definition: ged.h:202
struct directory * db_lookup(const struct db_i *, const char *name, int noisy)
Definition: db_lookup.c:153
int bu_ptbl_rm(struct bu_ptbl *b, const long *p)
struct rt_wdb * ged_wdbp
Definition: ged.h:340
Header file for the BRL-CAD common definitions.
db_op_t db_str2op(const char *str)
Definition: op.c:31
int bu_ptbl_ins(struct bu_ptbl *b, long *p)
#define ID_COMBINATION
Combination Record.
Definition: raytrace.h:499
struct rt_selection_set *(* ft_find_selections)(const struct rt_db_internal *, const struct rt_selection_query *)
Definition: raytrace.h:2217
ON_Brep * brep
Definition: brep_local.h:33
struct bn_vlblock * rt_vlblock_init(void)
Definition: vlist.c:71
int ged_brep(struct ged *gedp, int argc, const char *argv[])
Definition: brep.c:176
char ft_label[9]
Definition: raytrace.h:2044
struct rt_tess_tol wdb_ttol
Definition: raytrace.h:1268
int brep_intersect_point_curve(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j)
#define GED_ERROR
Definition: ged.h:61
struct bu_ptbl selections
holds struct rt_selection
Definition: raytrace.h:1959
Definition: ptbl.h:62
#define GED_DB_PUT_INTERNAL(_gedp, _dp, _intern, _resource, _flags)
Definition: ged.h:243
if(share_geom)
Definition: nmg_mod.c:3829
int brep_intersect_point_point(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j)
void bu_vls_free(struct bu_vls *vp)
Definition: vls.c:248
int brep_conversion(struct rt_db_internal *in, struct rt_db_internal *out, const struct db_i *dbip)
Definition: color.c:49
struct resource rt_uniresource
default. Defined in librt/globals.c
Definition: globals.c:41
#define GED_CHECK_DATABASE_OPEN(_gedp, _flags)
Definition: ged.h:114
db_op_t
Definition: op.h:33
#define RT_CK_DB_INTERNAL(_p)
Definition: raytrace.h:207
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
void(* free_selection)(struct rt_selection *)
Definition: raytrace.h:1964
#define BU_PTBL_GET(ptbl, i)
Definition: ptbl.h:108
void bu_vls_sprintf(struct bu_vls *vls, const char *fmt,...) _BU_ATTR_PRINTF23
Definition: vls.c:707
#define LOOKUP_QUIET
Definition: raytrace.h:893
const struct rt_functab * idb_meth
for ft_ifree(), etc.
Definition: raytrace.h:194
#define RT_DIR_PHONY_ADDR
Special marker for d_addr field.
Definition: raytrace.h:879
int brep_intersect_curve_curve(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j)
int mk_brep(struct rt_wdb *wdbp, const char *name, ON_Brep *brep)
Definition: brep.cpp:42
#define RT_SORT_CLOSEST_TO_START
Definition: raytrace.h:1994
#define GED_CHECK_DRAWABLE(_gedp, _flags)
Definition: ged.h:129
goto out
Definition: nmg_mod.c:3846
double mk_conv2mm
Conversion factor to mm.
Definition: units.c:37
Support for uniform tolerances.
Definition: tol.h:71
char * bu_vls_addr(const struct bu_vls *vp)
Definition: vls.c:111
struct bu_vls * ged_result_str
Definition: ged.h:357
int brep_conversion_comb(struct rt_db_internal *old_internal, const char *name, const char *suffix, struct rt_wdb *wdbp, fastf_t local2mm)
#define BU_FREE(_ptr, _type)
Definition: malloc.h:229
#define RT_SELECTION_TRANSLATION
Definition: raytrace.h:2018
#define BU_PTBL_LEN(ptbl)
Definition: ptbl.h:107
void bu_ptbl_free(struct bu_ptbl *b)
Definition: ptbl.c:226
void _ged_cvt_vlblock_to_solids(struct ged *gedp, struct bn_vlblock *vbp, const char *name, int copy)
Definition: draw.c:554
void * idb_ptr
Definition: raytrace.h:195
struct bn_tol wdb_tol
Definition: raytrace.h:1269
void bu_vls_printf(struct bu_vls *vls, const char *fmt,...) _BU_ATTR_PRINTF23
Definition: vls.c:694
#define RT_DIR_NULL
Definition: raytrace.h:875
#define LOOKUP_NOISY
Definition: raytrace.h:892
void * st_specific
-> ID-specific (private) struct
Definition: raytrace.h:435
int brep_intersect_curve_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j)
Definition: op.h:34
#define GED_HELP
Definition: ged.h:62
#define GED_DB_GET_INTERNAL(_gedp, _intern, _dp, _mat, _resource, _flags)
Definition: ged.h:233
Definition: color.c:51
Definition: vls.h:56
double fastf_t
Definition: defines.h:300
struct rt_selection_set * ged_get_selection_set(struct ged *gedp, const char *object_name, const char *selection_name)
Definition: select.c:298
void rt_db_free_internal(struct rt_db_internal *ip)
Definition: dir.c:216
int brep_intersect_point_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j)
Definition: color.c:50
int brep_intersect_surface_surface(struct rt_db_internal *intern1, struct rt_db_internal *intern2, int i, int j, struct bn_vlblock *vbp)
#define BU_STR_EQUAL(s1, s2)
Definition: str.h:126