commit 13d3f717144c5c1feee469c530b0b93bdb25ace4
parent bd368905dbc32a16cc87b5a7ea97b6827aad882d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 22 Feb 2017 10:21:45 +0100
Fix the computation of the mesh area
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/ssol_object.c b/src/ssol_object.c
@@ -221,7 +221,7 @@ ssol_object_clear(struct ssol_object* obj)
res_T
ssol_object_get_area(const struct ssol_object* object, double* area)
{
- if (!object || !area) return RES_BAD_ARG;;
+ if(!object || !area) return RES_BAD_ARG;;
/* the area of the 3D surface */
*area = object->scn_rt_area;
return RES_OK;
diff --git a/src/ssol_shape.c b/src/ssol_shape.c
@@ -461,7 +461,7 @@ quadric_setup_s3d_shape_rt
const struct darray_double* coords,
const struct darray_size_t* ids,
struct s3d_shape* shape,
- double * rt_area)
+ double* rt_area)
{
struct quadric_mesh_context ctx;
struct s3d_vertex_data vdata;
@@ -499,9 +499,10 @@ quadric_setup_s3d_shape_rt
res = s3d_mesh_setup_indexed_vertices
(shape, ntris, quadric_mesh_get_ids, nverts, &vdata, 1, &ctx);
- if (res != RES_OK) return res;
+ if(res != RES_OK) return res;
+
*rt_area = mesh_compute_area
- (ntris, quadric_mesh_get_ids, nverts, quadric_mesh_parabol_get_pos, &ctx);
+ (ntris, quadric_mesh_get_ids, nverts, vdata.get, &ctx);
return RES_OK;
}