X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=energy.c;h=19f32e2fa3a0459ab94339a202b6844120b0a8b1;hp=c0090677b40f43c4cb09da43b36412741a06c63d;hb=32c7d2a5c5cb58ed3a8fb9fc383a31a80b01c052;hpb=30d841cc8a4e2ae0bec21b58e3c73057e4286f06 diff --git a/energy.c b/energy.c index c009067..19f32e2 100644 --- a/energy.c +++ b/energy.c @@ -36,30 +36,39 @@ static const CostContribution costs[]= { #if XBITS==3 #define STOP_EPSILON 1e-6 - COST( 3e3, line_bending_cost) - COST( 3e3, edge_length_variation_cost) + COST( 3e3, vertex_displacement_cost) COST( 0.4e3, rim_proximity_cost) - COST( 1e6, edge_angle_cost) + COST( 1e7, edge_angle_cost) + #define EDGE_ANGLE_COST_CIRCCIRCRAT (0.2/1.7) + COST( 1e2, small_triangles_cost) + COST( 1e12, noncircular_rim_cost) +#endif + +#if XBITS==4 +#define STOP_EPSILON 1.2e-4 + COST( 3e3, vertex_displacement_cost) + COST( 0.2e3, rim_proximity_cost) +// COST( 1e6, edge_angle_cost) #define EDGE_ANGLE_COST_CIRCCIRCRAT (0.5/1.7) // COST( 1e1, small_triangles_cost) COST( 1e12, noncircular_rim_cost) #endif -#if XBITS==4 -#define STOP_EPSILON 1e-6 - COST( 3e5, line_bending_cost) - COST( 10e2, edge_length_variation_cost) - COST( 9.0e1, rim_proximity_cost) // 5e1 is too much +#if XBITS==5 +#define STOP_EPSILON 1.2e-4 + COST( 3e7, line_bending_cost) + COST( 10e2, prop_edge_length_variation_cost) + COST( 9.0e3, rim_proximity_cost) // 5e1 is too much // 2.5e1 is too little // 0.2e1 grows compared to previous ? // 0.6e0 shrinks compared to previous ? - COST( 1e12, edge_angle_cost) +// COST( 1e12, edge_angle_cost) #define EDGE_ANGLE_COST_CIRCCIRCRAT (0.5/1.3) COST( 1e18, noncircular_rim_cost) #endif -#if XBITS==5 +#if XBITS>=6 /* nonsense follows but never mind */ #define STOP_EPSILON 1e-6 COST( 3e5, line_bending_cost) COST( 10e2, edge_length_variation_cost) @@ -89,7 +98,7 @@ void compute_energy_separately(const struct Vertices *vs, int ci; for (ci=0; cia, section); + precomps[ci](vs->a, section); inparallel_barrier(); } for (ci=0; ci