Revision: 54342 http://brlcad.svn.sourceforge.net/brlcad/?rev=54342&view=rev Author: bob1961 Date: 2013-02-08 14:19:52 +0000 (Fri, 08 Feb 2013) Log Message: ----------- Update _ged_append_pipept_common to expect the incoming point to be in view coordinates. Also, use the view Z calculated from the previous point to replace the view Z of the incoming/new point.
Modified Paths: -------------- brlcad/trunk/src/libged/edpipe.c brlcad/trunk/src/libtclcad/tclcad_obj.c Modified: brlcad/trunk/src/libged/edpipe.c =================================================================== --- brlcad/trunk/src/libged/edpipe.c 2013-02-08 13:24:45 UTC (rev 54341) +++ brlcad/trunk/src/libged/edpipe.c 2013-02-08 14:19:52 UTC (rev 54342) @@ -606,11 +606,15 @@ struct rt_db_internal intern; struct rt_pipe_internal *pipeip; mat_t mat; + point_t view_ps_pt; + point_t view_pp_coord; point_t ps_pt; + struct wdb_pipept *prevpp; double scan[3]; char *last; GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR); + GED_CHECK_VIEW(gedp, GED_ERROR); GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); /* initialize result */ @@ -648,7 +652,7 @@ return GED_ERROR; } /* convert from double to fastf_t */ - VMOVE(ps_pt, scan); + VMOVE(view_ps_pt, scan); if (wdb_import_from_path2(gedp->ged_result_str, &intern, argv[1], gedp->ged_wdbp, mat) == GED_ERROR) return GED_ERROR; @@ -662,6 +666,17 @@ } pipeip = (struct rt_pipe_internal *)intern.idb_ptr; + + /* use the view z from the first or last pipe point, depending on whether we're appending or prepending */ + if (func == _ged_add_pipept) + prevpp = BU_LIST_LAST(wdb_pipept, &pipeip->pipe_segs_head); + else + prevpp = BU_LIST_FIRST(wdb_pipept, &pipeip->pipe_segs_head); + + MAT4X3PNT(view_pp_coord, gedp->ged_gvp->gv_model2view, prevpp->pp_coord); + view_ps_pt[Z] = view_pp_coord[Z]; + MAT4X3PNT(ps_pt, gedp->ged_gvp->gv_view2model, view_ps_pt); + if ((*func)(pipeip, (struct wdb_pipept *)NULL, ps_pt) == (struct wdb_pipept *)NULL) { rt_db_free_internal(&intern); bu_vls_printf(gedp->ged_result_str, "%s: cannot move point there", argv[0]); Modified: brlcad/trunk/src/libtclcad/tclcad_obj.c =================================================================== --- brlcad/trunk/src/libtclcad/tclcad_obj.c 2013-02-08 13:24:45 UTC (rev 54341) +++ brlcad/trunk/src/libtclcad/tclcad_obj.c 2013-02-08 14:19:52 UTC (rev 54342) @@ -6191,7 +6191,6 @@ fastf_t inv_width; fastf_t inv_height; fastf_t inv_aspect; - point_t model; point_t view; struct bu_vls pt_vls = BU_VLS_INIT_ZERO; struct ged_dm_view *gdvp; @@ -6240,10 +6239,8 @@ if (gedp->ged_gvp->gv_grid.ggs_snap) ged_snap_to_grid(gedp, &view[X], &view[Y]); - MAT4X3PNT(model, gdvp->gdv_view->gv_view2model, view); + bu_vls_printf(&pt_vls, "%lf %lf %lf", view[X], view[Y], view[Z]); - bu_vls_printf(&pt_vls, "%lf %lf %lf", model[X], model[Y], model[Z]); - gedp->ged_gvp = gdvp->gdv_view; av[0] = (char *)argv[0]; av[1] = (char *)argv[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits