Revision: 53673 http://brlcad.svn.sourceforge.net/brlcad/?rev=53673&view=rev Author: n_reed Date: 2012-11-14 15:24:39 +0000 (Wed, 14 Nov 2012) Log Message: ----------- use spacing parameters to choose number of points/curves to plot
Modified Paths: -------------- brlcad/trunk/src/librt/primitives/epa/epa.c Modified: brlcad/trunk/src/librt/primitives/epa/epa.c =================================================================== --- brlcad/trunk/src/librt/primitives/epa/epa.c 2012-11-14 15:04:05 UTC (rev 53672) +++ brlcad/trunk/src/librt/primitives/epa/epa.c 2012-11-14 15:24:39 UTC (rev 53673) @@ -791,6 +791,19 @@ } } +static int +epa_ellipse_points( + struct rt_epa_internal *epa, + const struct rt_view_info *info) +{ + fastf_t avg_radius, avg_circumference; + + avg_radius = (epa->epa_r1 + epa->epa_r2) / 2.0; + avg_circumference = bn_twopi * avg_radius; + + return avg_circumference / info->point_spacing; +} + int rt_epa_adaptive_plot(struct rt_db_internal *ip, const struct rt_view_info *info) { @@ -800,14 +813,6 @@ struct rt_epa_internal *epa; struct rt_pt_node *pts_r1, *pts_r2, *node, *node1, *node2; - num_curve_points = sqrt(primitive_diagonal_samples(ip, info)) / 4.0; - - if (num_curve_points < 3) { - num_curve_points = 3; - } - - num_ellipse_points = 4 * num_curve_points; - BU_CK_LIST_HEAD(info->vhead); RT_CK_DB_INTERNAL(ip); @@ -816,6 +821,19 @@ return -2; } + num_curve_points = primitive_curve_count(ip, info); + + if (num_curve_points < 3) { + num_curve_points = 3; + } + + num_ellipse_points = epa_ellipse_points(epa, info); + + if (num_ellipse_points < 6) { + num_ellipse_points = 6; + } + + VMOVE(epa_H, epa->epa_H); mag_H = MAGNITUDE(epa_H); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits