commit 08b92bd511a6f08b4d3623e9f1a1c587de678175
parent ce8846ae7989089765c40e2e2cceb8d1664ffb8e
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Thu, 12 Jun 2025 15:39:34 +0200
Rename a few vars
Diffstat:
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/scad.h b/src/scad.h
@@ -196,12 +196,12 @@ SCAD_API res_T
scad_scene_clear
(void);
-/* Write the whole scene in a format that depends on the file name extension.
+/* Write the whole scene in a format that depends on filename extension.
* Available formats include "brep", "msh" (gmsh-specific format), "step",
* "stl", "vtk", etc. */
SCAD_API res_T
scad_scene_write
- (const char* name);
+ (const char* filename);
/* Create the mesh of the whole scene.
* Note that, due to gmsh capabilities, there is no way to mesh a given list of
@@ -552,7 +552,7 @@ scad_geometry_extrude
* The output geometries are named <base>_<rank>, where <base> is either
* prefix_name (first choice) or geom's name, and <rank> * counting from 0.
* If neither `prefix_name' nor `geom's name are defined, the geometries are
- * created unamed.
+ * created unnamed.
* Whatever the names, if defined they must be unique.
* The result `out_geometries' being allocated using the allocator provided when
* initializing star-cad, it should be freed accordingly. */
@@ -642,15 +642,15 @@ scad_step_import
/* Export the mesh of geometry `geom' to an STL file.
* In order to get a mesh, one has to call scad_scene_mesh before calling this.
- * If `file_name' is provided it is used to name the file (just adding .stl),
+ * If `filename' is provided it is used to name the file (just adding .stl),
* otherwise the geometry name is used instead (and it is an error if neither
- * file_name nor the geometry name is defined). Mesh orientation can be forced
+ * filename nor the geometry name is defined). Mesh orientation can be forced
* inward or outward only if it defines a closed volume. The file format is
* either binary or ascii, depending on the value of the `binary' argument. */
SCAD_API res_T
scad_stl_export
(struct scad_geometry* geom,
- const char* file_name,
+ const char* filename,
const enum scad_normals_orientation orientation,
const int binary); /* File format */
@@ -660,17 +660,17 @@ scad_stl_export_partial
(struct scad_geometry* geometry,
struct scad_geometry** exclude,
const size_t exclude_count,
- const char* file_name,
+ const char* filename,
const enum scad_normals_orientation orientation,
const int binary);
/* Export the geometry `geom' in as many files than its count.
- * The files are named <base>_<rank>.stl, where <base> is either file_name or
+ * The files are named <base>_<rank>.stl, where <base> is either filename or
* geom's name, and <rank> counting from 0. */
SCAD_API res_T
scad_stl_export_split
(struct scad_geometry* geom,
- const char* file_name,
+ const char* filename,
const enum scad_normals_orientation orientation,
const int binary); /* File format */
diff --git a/src/scad_geometry.c b/src/scad_geometry.c
@@ -1891,7 +1891,7 @@ scad_geometry_explode
(const struct scad_geometry* geom,
const char* prefix_name, /* Can be NULL */
struct scad_geometry*** out_geometry,
- size_t* out_geometry_n)
+ size_t* out_n)
{
res_T res = RES_OK;
int* data = NULL;
@@ -1903,7 +1903,7 @@ scad_geometry_explode
struct mem_allocator* allocator = NULL;
const char* base_name = NULL;
- if(!geom || !out_geometry || !out_geometry_n) {
+ if(!geom || !out_geometry || !out_n) {
res = RES_BAD_ARG;
goto error;
}
@@ -1949,7 +1949,7 @@ scad_geometry_explode
}
exit:
- if(out_geometry_n) *out_geometry_n = sz/2 ;
+ if(out_n) *out_n = sz/2 ;
if(out_geometry) *out_geometry = geom_array;
if(name_initialized) str_release(&name);
return res;
@@ -2609,9 +2609,9 @@ error:
res_T
scad_step_import
(const char* filename,
- const char* name,
+ const char* prefix_name,
struct scad_geometry*** out_geometry,
- size_t* out_geometry_n)
+ size_t* out_n)
{
int ierr;
int* tagout = NULL;
@@ -2623,7 +2623,7 @@ scad_step_import
struct scad_device* dev = get_device();
res_T res = RES_OK;
- if(!filename || !out_geometry || !out_geometry_n) {
+ if(!filename || !out_geometry || !out_n) {
res = RES_BAD_ARG;
goto error;
}
@@ -2646,8 +2646,8 @@ scad_step_import
str_init(allocator, &strname);
name_initialized = 1;
for(i=0; i<ga_sz; ++i) {
- if (name) {
- ERR(str_set(&strname, name));
+ if (prefix_name) {
+ ERR(str_set(&strname, prefix_name));
ERR(str_append_printf(&strname,"_%lu", (unsigned long)i));
ERR(geometry_create(str_cget(&strname), geom_array+i));
} else {
@@ -2669,7 +2669,7 @@ scad_step_import
exit:
gmshFree(tagout);
- if(out_geometry_n) *out_geometry_n = ga_sz ;
+ if(out_n) *out_n = ga_sz ;
if(out_geometry) *out_geometry = geom_array;
if(name_initialized) str_release(&strname);
return res;