BRL-CAD
coil.c File Reference
#include "common.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "bu/getopt.h"
#include "vmath.h"
#include "bn.h"
#include "raytrace.h"
#include "wdb.h"
#include "ged.h"
Include dependency graph for coil.c:

Go to the source code of this file.

Data Structures

struct  coil_data_t
 

Macros

#define D2R(x)   (x * DEG2RAD)
 
#define DEFAULT_COIL_OBJECT   "coil"
 
#define DEFAULT_COIL_FILENAME   "coil.g"
 

Functions

fastf_t cap_squared (struct bu_list *head, fastf_t mean_outer_diameter, fastf_t wire_diameter, fastf_t helix_angle, fastf_t pitch, fastf_t starting_pitch, int is_start, int *need_subtraction, int lhf)
 
fastf_t cap_squared_ground (struct rt_wdb *file, struct bu_list *head, char *prefix, struct wmember *coil_subtractions, fastf_t mean_outer_diameter, fastf_t wire_diameter, fastf_t helix_angle, fastf_t pitch, fastf_t starting_pitch, int is_start, int *need_subtraction, int lhf)
 
fastf_t cap_ground (struct rt_wdb *file, struct bu_list *head, char *prefix, struct wmember *coil_subtractions, fastf_t mean_outer_diameter, fastf_t wire_diameter, fastf_t helix_angle, fastf_t pitch, fastf_t starting_pitch, int is_start, int *need_subtraction, int lhf)
 
fastf_t helical_coil_plain (struct bu_list *head, fastf_t mean_outer_diameter, fastf_t wire_diameter, fastf_t helix_angle, fastf_t pitch, fastf_t starting_pitch, int nt, int lhf)
 
void make_coil (struct rt_wdb(*file), char *prefix, struct bu_list *sections, int start_cap_type, int end_cap_type)
 
void usage (struct ged *gedp)
 
int ReadArgs (struct ged *gedp, int argc, const char *argv[], struct bu_vls *name, struct bu_list *sections, fastf_t *mean_outer_diameter, fastf_t *wire_diameter, fastf_t *helix_angle, fastf_t *pitch, int *nt, int *start_cap_type, int *end_cap_type, fastf_t *overall_length, int *lhf)
 
int ged_coil (struct ged *gedp, int argc, const char *argv[])
 

Variables

int usedefaults
 

Detailed Description

Generator logic for creating coils.

Definition in file coil.c.

Macro Definition Documentation

#define D2R (   x)    (x * DEG2RAD)

Definition at line 41 of file coil.c.

Referenced by cap_ground(), cap_squared(), cap_squared_ground(), and helical_coil_plain().

#define DEFAULT_COIL_OBJECT   "coil"

Definition at line 42 of file coil.c.

Referenced by ged_coil(), and ReadArgs().

#define DEFAULT_COIL_FILENAME   "coil.g"

Definition at line 43 of file coil.c.

Referenced by ged_coil().

Function Documentation

fastf_t cap_squared ( struct bu_list head,
fastf_t  mean_outer_diameter,
fastf_t  wire_diameter,
fastf_t  helix_angle,
fastf_t  pitch,
fastf_t  starting_pitch,
int  is_start,
int *  need_subtraction,
int  lhf 
)

Definition at line 59 of file coil.c.

References D2R, mk_add_pipe_pt(), and VSET.

Referenced by make_coil().

Here is the call graph for this function:

fastf_t cap_squared_ground ( struct rt_wdb file,
struct bu_list head,
char *  prefix,
struct wmember coil_subtractions,
fastf_t  mean_outer_diameter,
fastf_t  wire_diameter,
fastf_t  helix_angle,
fastf_t  pitch,
fastf_t  starting_pitch,
int  is_start,
int *  need_subtraction,
int  lhf 
)

Definition at line 100 of file coil.c.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_sprintf(), D2R, mk_add_pipe_pt(), mk_addmember(), mk_rcc(), VSET, and WMOP_UNION.

Referenced by make_coil().

Here is the call graph for this function:

fastf_t cap_ground ( struct rt_wdb file,
struct bu_list head,
char *  prefix,
struct wmember coil_subtractions,
fastf_t  mean_outer_diameter,
fastf_t  wire_diameter,
fastf_t  helix_angle,
fastf_t  pitch,
fastf_t  starting_pitch,
int  is_start,
int *  need_subtraction,
int  lhf 
)

Definition at line 152 of file coil.c.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_trunc(), D2R, mk_add_pipe_pt(), mk_addmember(), mk_rcc(), VSET, and WMOP_UNION.

Referenced by make_coil().

Here is the call graph for this function:

fastf_t helical_coil_plain ( struct bu_list head,
fastf_t  mean_outer_diameter,
fastf_t  wire_diameter,
fastf_t  helix_angle,
fastf_t  pitch,
fastf_t  starting_pitch,
int  nt,
int  lhf 
)

Definition at line 208 of file coil.c.

References D2R, mk_add_pipe_pt(), and VSET.

Referenced by make_coil().

Here is the call graph for this function:

void make_coil ( struct rt_wdb file,
char *  prefix,
struct bu_list sections,
int  start_cap_type,
int  end_cap_type 
)
void usage ( struct ged gedp)

Definition at line 315 of file coil.c.

References bu_vls_printf(), and ged::ged_result_str.

Referenced by _ged_append_pipept_common(), annotate_help(), edarb_facedef(), ged_3ptarb(), ged_add_metaballpt(), ged_adjust(), ged_ae2dir(), ged_aet(), ged_analyze(), ged_arb(), ged_arced(), ged_arot_args(), ged_attr(), ged_bb(), ged_bev(), ged_blast(), ged_bo(), ged_bot(), ged_bot_condense(), ged_bot_decimate(), ged_bot_edge_split(), ged_bot_face_fuse(), ged_bot_face_sort(), ged_bot_face_split(), ged_bot_flip(), ged_bot_fuse(), ged_bot_merge(), ged_bot_smooth(), ged_bot_split(), ged_bot_sync(), ged_bot_vertex_fuse(), ged_brep(), ged_cat(), ged_cc(), ged_center(), ged_color(), ged_comb(), ged_comb_color(), ged_comb_std(), ged_combmem(), ged_concat(), ged_copy(), ged_copyeval(), ged_copymat(), ged_cpi(), ged_debugbu(), ged_debuglib(), ged_debugnmg(), ged_decompose(), ged_delay(), ged_delete_metaballpt(), ged_delete_pipept(), ged_dir2ae(), ged_draw_guts(), ged_dump(), ged_dup(), ged_E(), ged_eac(), ged_echo(), ged_edcodes(), ged_edcomb(), ged_edit(), ged_edmater(), ged_erase(), ged_exists(), ged_expand(), ged_eye(), ged_eye_pos(), ged_facetize(), ged_fb2pix(), ged_fbclear(), ged_find(), ged_find_arb_edge_nearest_pt(), ged_find_bot_edge_nearest_pt(), ged_find_botpt_nearest_pt(), ged_find_metaballpt_nearest_pt(), ged_find_pipept_nearest_pt(), ged_form(), ged_fracture(), ged_get(), ged_get_bot_edges(), ged_get_comb(), ged_get_type(), ged_getmat(), ged_glob(), ged_gqa(), ged_grid2model_lu(), ged_grid2view_lu(), ged_group(), ged_hide(), ged_how(), ged_illum(), ged_importFg4Section(), ged_instance(), ged_item(), ged_keep(), ged_keypoint(), ged_kill(), ged_killall(), ged_killrefs(), ged_killtree(), ged_label(), ged_lc(), ged_list(), ged_loadview(), ged_lod(), ged_log(), ged_lookat(), ged_ls(), ged_lt(), ged_m2v_point(), ged_make(), ged_make_name(), ged_make_pnts(), ged_match(), ged_mater(), ged_mirror(), ged_model2grid_lu(), ged_model2view(), ged_model2view_lu(), ged_move(), ged_move_all(), ged_move_arb_edge(), ged_move_arb_face(), ged_move_botpt(), ged_move_botpts(), ged_move_metaballpt(), ged_move_pipept(), ged_mrot(), ged_nmg_collapse(), ged_nmg_fix_normals(), ged_nmg_simplify(), ged_ocenter(), ged_orient(), ged_orotate(), ged_oscale(), ged_otranslate(), ged_overlay(), ged_pathlist(), ged_perspective(), ged_plot(), ged_png(), ged_polybinout(), ged_pov(), ged_prefix(), ged_preview(), ged_protate(), ged_ps(), ged_pscale(), ged_pset(), ged_ptranslate(), ged_pull(), ged_push(), ged_put(), ged_put_comb(), ged_putmat(), ged_qray(), ged_quat(), ged_qvrot(), ged_rect(), ged_red(), ged_regdef(), ged_region(), ged_remove(), ged_reopen(), ged_report(), ged_rfarb(), ged_rmater(), ged_rot_args(), ged_rot_point(), ged_rotate_about(), ged_rotate_arb_face(), ged_rselect(), ged_savekey(), ged_saveview(), ged_scale_args(), ged_screen_grab(), ged_search(), ged_select(), ged_set_output_script(), ged_set_transparency(), ged_set_uplotOutputMode(), ged_setview(), ged_shaded_mode(), ged_shader(), ged_shells(), ged_showmats(), ged_size(), ged_slew(), ged_solids_on_ray(), ged_sphgroup(), ged_summary(), ged_tables(), ged_tol(), ged_tra_args(), ged_track(), ged_tree(), ged_unhide(), ged_units(), ged_v2m_point(), ged_view2grid_lu(), ged_view2model_lu(), ged_view2model_vec(), ged_view_func(), ged_viewdir(), ged_vnirt(), ged_voxelize(), ged_vrot(), ged_wcodes(), ged_whatid(), ged_which_shader(), ged_who(), ged_wmater(), ged_xpush(), ged_ypr(), ReadArgs(), vdraw_delete(), and vdraw_insert().

Here is the call graph for this function:

int ReadArgs ( struct ged gedp,
int  argc,
const char *  argv[],
struct bu_vls name,
struct bu_list sections,
fastf_t mean_outer_diameter,
fastf_t wire_diameter,
fastf_t helix_angle,
fastf_t pitch,
int *  nt,
int *  start_cap_type,
int *  end_cap_type,
fastf_t overall_length,
int *  lhf 
)

Definition at line 326 of file coil.c.

References BU_ALLOC, bu_getopt(), BU_LIST_INSERT, bu_optarg, bu_optind, bu_vls_printf(), bu_vls_sprintf(), DEFAULT_COIL_OBJECT, GED_ERROR, GED_OK, ged::ged_result_str, coil_data_t::ha, coil_data_t::lhf, coil_data_t::nt, coil_data_t::od, options, coil_data_t::p, usage(), usedefaults, and coil_data_t::wd.

Referenced by ged_coil(), and ged_tire().

Here is the call graph for this function:

int ged_coil ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Variable Documentation

int usedefaults

Definition at line 45 of file coil.c.

Referenced by ged_coil(), and ReadArgs().