Skip to content

Commit

Permalink
minimal creation func for arbn
Browse files Browse the repository at this point in the history
arbn's need atleast 1 eqn to be valid
  • Loading branch information
f4alt committed Aug 10, 2023
1 parent 1bc71b7 commit 3a68f72
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/librt/primitives/arbn/arbn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,25 @@ rt_arbn_adjust(struct bu_vls *logstr, struct rt_db_internal *intern, int argc, c
return BRLCAD_OK;
}

void
rt_arbn_make(const struct rt_functab *ftp, struct rt_db_internal *intern)
{
struct rt_arbn_internal *aip;

intern->idb_type = ID_ARBN;
intern->idb_major_type = DB5_MAJORTYPE_BRLCAD;

BU_ASSERT(&OBJ[intern->idb_type] == ftp);
intern->idb_meth = ftp;

BU_ALLOC(aip, struct rt_arbn_internal);
intern->idb_ptr = (void *)aip;

aip->magic = RT_ARBN_INTERNAL_MAGIC;
aip->neqn = 1;
aip->eqn = (plane_t *)bu_calloc(aip->neqn, sizeof(plane_t), "arbn plane");
}


int
rt_arbn_params(struct pc_pc_set *UNUSED(ps), const struct rt_db_internal *ip)
Expand Down
2 changes: 1 addition & 1 deletion src/librt/primitives/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ const struct rt_functab OBJ[] = {
RTFUNCTAB_FUNC_GET_CAST(rt_arbn_get),
RTFUNCTAB_FUNC_ADJUST_CAST(rt_arbn_adjust),
RTFUNCTAB_FUNC_FORM_CAST(rt_generic_form),
NULL, /* make */
RTFUNCTAB_FUNC_MAKE_CAST(rt_arbn_make),
RTFUNCTAB_FUNC_PARAMS_CAST(rt_arbn_params),
RTFUNCTAB_FUNC_BBOX_CAST(rt_arbn_bbox),
RTFUNCTAB_FUNC_VOLUME_CAST(rt_arbn_volume),
Expand Down

0 comments on commit 3a68f72

Please sign in to comment.