Revision: 53672
http://brlcad.svn.sourceforge.net/brlcad/?rev=53672&view=rev
Author: n_reed
Date: 2012-11-14 15:04:05 +0000 (Wed, 14 Nov 2012)
Log Message:
-----------
try to satisfy spacing requirements
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/ehy/ehy.c
Modified: brlcad/trunk/src/librt/primitives/ehy/ehy.c
===================================================================
--- brlcad/trunk/src/librt/primitives/ehy/ehy.c 2012-11-14 14:28:47 UTC (rev
53671)
+++ brlcad/trunk/src/librt/primitives/ehy/ehy.c 2012-11-14 15:04:05 UTC (rev
53672)
@@ -830,6 +830,19 @@
}
}
+static int
+ehy_ellipse_points(
+ struct rt_ehy_internal *ehy,
+ const struct rt_view_info *info)
+{
+ fastf_t avg_radius, avg_circumference;
+
+ avg_radius = (ehy->ehy_r1 + ehy->ehy_r2) / 2.0;
+ avg_circumference = bn_twopi * avg_radius;
+
+ return avg_circumference / info->point_spacing;
+}
+
int
rt_ehy_adaptive_plot(struct rt_db_internal *ip, const struct rt_view_info
*info)
{
@@ -839,18 +852,22 @@
struct rt_ehy_internal *ehy;
struct rt_pt_node *pts_r1, *pts_r2, *node, *node1, *node2;
- num_curve_points = sqrt(primitive_diagonal_samples(ip, info)) / 4.0;
+ BU_CK_LIST_HEAD(info->vhead);
+ RT_CK_DB_INTERNAL(ip);
+ ehy = (struct rt_ehy_internal *)ip->idb_ptr;
+ RT_EHY_CK_MAGIC(ehy);
+ num_curve_points = primitive_curve_count(ip, info);
+
if (num_curve_points < 3) {
num_curve_points = 3;
}
- num_ellipse_points = 4 * num_curve_points;
+ num_ellipse_points = ehy_ellipse_points(ehy, info);
- BU_CK_LIST_HEAD(info->vhead);
- RT_CK_DB_INTERNAL(ip);
- ehy = (struct rt_ehy_internal *)ip->idb_ptr;
- RT_EHY_CK_MAGIC(ehy);
+ if (num_ellipse_points < 6) {
+ num_ellipse_points = 6;
+ }
VMOVE(ehy_H, ehy->ehy_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
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits