mirror of https://github.com/vitalif/openscad
Update gettext calls.
parent
5e257b1a1c
commit
38129cec19
|
@ -72,7 +72,7 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset() const
|
|||
if (!err) err = createPolySetFromPolyhedron(P, *ps);
|
||||
if (err) {
|
||||
PRINT(_("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed."));
|
||||
if (errmsg!="") PRINTB("ERROR: %s",errmsg);
|
||||
if (errmsg!="") PRINTB(_("ERROR: %s"),errmsg);
|
||||
delete ps; ps = NULL;
|
||||
}
|
||||
CGAL::set_error_behaviour(old_behaviour);
|
||||
|
|
|
@ -11,7 +11,7 @@ shared_ptr<const Geometry> GeometryCache::get(const std::string &id) const
|
|||
{
|
||||
const shared_ptr<const Geometry> &geom = this->cache[id]->geom;
|
||||
#ifdef DEBUG
|
||||
PRINTB("Geometry Cache hit: %s (%d bytes)", id.substr(0, 40) % (geom ? geom->memsize() : 0));
|
||||
PRINTB(_("Geometry Cache hit: %s (%d bytes)"), id.substr(0, 40) % (geom ? geom->memsize() : 0));
|
||||
#endif
|
||||
return geom;
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ bool GeometryCache::insert(const std::string &id, const shared_ptr<const Geometr
|
|||
bool inserted = this->cache.insert(id, new cache_entry(geom), geom ? geom->memsize() : 0);
|
||||
#ifdef DEBUG
|
||||
assert(!dynamic_cast<const CGAL_Nef_polyhedron*>(geom.get()));
|
||||
if (inserted) PRINTB("Geometry Cache insert: %s (%d bytes)",
|
||||
if (inserted) PRINTB(_("Geometry Cache insert: %s (%d bytes)"),
|
||||
id.substr(0, 40) % (geom ? geom->memsize() : 0));
|
||||
else PRINTB("Geometry Cache insert failed: %s (%d bytes)",
|
||||
else PRINTB(_("Geometry Cache insert failed: %s (%d bytes)"),
|
||||
id.substr(0, 40) % (geom ? geom->memsize() : 0));
|
||||
#endif
|
||||
return inserted;
|
||||
|
@ -41,8 +41,8 @@ void GeometryCache::setMaxSize(size_t limit)
|
|||
|
||||
void GeometryCache::print()
|
||||
{
|
||||
PRINTB("Geometries in cache: %d", this->cache.size());
|
||||
PRINTB("Geometry cache size in bytes: %d", this->cache.totalCost());
|
||||
PRINTB(_("Geometries in cache: %d"), this->cache.size());
|
||||
PRINTB(_("Geometry cache size in bytes: %d"), this->cache.totalCost());
|
||||
}
|
||||
|
||||
GeometryCache::cache_entry::cache_entry(const shared_ptr<const Geometry> &geom)
|
||||
|
|
|
@ -73,7 +73,7 @@ GeometryEvaluator::ResultObject GeometryEvaluator::applyToChildren(const Abstrac
|
|||
if (item.second) {
|
||||
if (!dim) dim = item.second->getDimension();
|
||||
else if (dim != item.second->getDimension()) {
|
||||
PRINT("WARNING: Mixing 2D and 3D objects is not supported.");
|
||||
PRINT(_("WARNING: Mixing 2D and 3D objects is not supported."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ void GeometryEvaluator::applyResize3D(CGAL_Nef_polyhedron &N,
|
|||
for (int i=0;i<N.getDimension();i++) {
|
||||
if (newsize[i]) {
|
||||
if (bbox_size[i] == NT3(0)) {
|
||||
PRINT("WARNING: Resize in direction normal to flat object is not implemented");
|
||||
PRINT(_("WARNING: Resize in direction normal to flat object is not implemented"));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -249,7 +249,7 @@ std::vector<const class Polygon2d *> GeometryEvaluator::collectChildren2D(const
|
|||
children.push_back(polygons);
|
||||
}
|
||||
else {
|
||||
PRINT("WARNING: Ignoring 3D child object for 2D operation");
|
||||
PRINT(_("WARNING: Ignoring 3D child object for 2D operation"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ void GeometryEvaluator::smartCacheInsert(const AbstractNode &node,
|
|||
else {
|
||||
if (!GeometryCache::instance()->contains(key)) {
|
||||
if (!GeometryCache::instance()->insert(key, geom)) {
|
||||
PRINT("WARNING: GeometryEvaluator: Node didn't fit into cache");
|
||||
PRINT(_("WARNING: GeometryEvaluator: Node didn't fit into cache"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ Geometry::ChildList GeometryEvaluator::collectChildren3D(const AbstractNode &nod
|
|||
children.push_back(item);
|
||||
}
|
||||
else {
|
||||
PRINT("WARNING: Ignoring 2D child object for 3D operation");
|
||||
PRINT(_("WARNING: Ignoring 2D child object for 3D operation"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ Polygon2d *GeometryEvaluator::applyToChildren2D(const AbstractNode &node, OpenSC
|
|||
clipType = ClipperLib::ctDifference;
|
||||
break;
|
||||
default:
|
||||
PRINTB("Error: Unknown boolean operation %d", int(op));
|
||||
PRINTB(_("Error: Unknown boolean operation %d"), int(op));
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
|
@ -514,7 +514,7 @@ Response GeometryEvaluator::visit(State &state, const TransformNode &node)
|
|||
if (!isSmartCached(node)) {
|
||||
if (matrix_contains_infinity(node.matrix) || matrix_contains_nan(node.matrix)) {
|
||||
// due to the way parse/eval works we can't currently distinguish between NaN and Inf
|
||||
PRINT("Warning: Transformation matrix contains Not-a-Number and/or Infinity - removing object.");
|
||||
PRINT(_("Warning: Transformation matrix contains Not-a-Number and/or Infinity - removing object."));
|
||||
}
|
||||
else {
|
||||
// First union all children
|
||||
|
@ -762,7 +762,7 @@ static Geometry *rotatePolygon(const RotateExtrudeNode &node, const Polygon2d &p
|
|||
max_x = fmax(max_x, v[0]);
|
||||
|
||||
if ((max_x - min_x) > max_x && (max_x - min_x) > fabs(min_x)) {
|
||||
PRINTB("ERROR: all points for rotate_extrude() must have the same X coordinate sign (range is %.2f -> %.2f)", min_x % max_x);
|
||||
PRINTB(_("ERROR: all points for rotate_extrude() must have the same X coordinate sign (range is %.2f -> %.2f)"), min_x % max_x);
|
||||
delete ps;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ OffscreenView::~OffscreenView()
|
|||
#ifdef ENABLE_OPENCSG
|
||||
void OffscreenView::display_opencsg_warning()
|
||||
{
|
||||
PRINT("OpenSCAD recommended OpenGL version is 2.0.");
|
||||
PRINT(_("OpenSCAD recommended OpenGL version is 2.0."));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace CGALUtils {
|
|||
const CGAL_Nef_polyhedron *N = dynamic_cast<const CGAL_Nef_polyhedron *>(chgeom.get());
|
||||
if (N) {
|
||||
if (!N->p3->is_simple()) {
|
||||
PRINT("Hull() currently requires a valid 2-manifold. Please modify your design. See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export");
|
||||
PRINT(_("Hull() currently requires a valid 2-manifold. Please modify your design. See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export"));
|
||||
}
|
||||
else {
|
||||
bool err = true;
|
||||
|
@ -41,8 +41,8 @@ namespace CGALUtils {
|
|||
errmsg = std::string(e.what());
|
||||
}
|
||||
if (err) {
|
||||
PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed.");
|
||||
if (errmsg!="") PRINTB("ERROR: %s",errmsg);
|
||||
PRINT(_("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed."));
|
||||
if (errmsg!="") PRINTB(_("ERROR: %s"),errmsg);
|
||||
} else {
|
||||
std::transform(P.vertices_begin(), P.vertices_end(), std::back_inserter(points),
|
||||
boost::bind(static_cast<const CGAL_Polyhedron::Vertex::Point_3&(CGAL_Polyhedron::Vertex::*)() const>(&CGAL_Polyhedron::Vertex::point), _1));
|
||||
|
@ -104,13 +104,13 @@ namespace CGALUtils {
|
|||
target.minkowski(src);
|
||||
break;
|
||||
default:
|
||||
PRINTB("ERROR: Unsupported CGAL operator: %d", op);
|
||||
PRINTB(_("ERROR: Unsupported CGAL operator: %d"), op);
|
||||
}
|
||||
}
|
||||
catch (const CGAL::Failure_exception &e) {
|
||||
// union && difference assert triggered by testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad and testdata/scad/bugs/issue204.scad
|
||||
std::string opstr = op == OPENSCAD_UNION ? "union" : op == OPENSCAD_INTERSECTION ? "intersection" : op == OPENSCAD_DIFFERENCE ? "difference" : op == OPENSCAD_MINKOWSKI ? "minkowski" : "UNKNOWN";
|
||||
PRINTB("CGAL error in CGALUtils::applyBinaryOperator %s: %s", opstr % e.what());
|
||||
PRINTB(_("CGAL error in CGALUtils::applyBinaryOperator %s: %s"), opstr % e.what());
|
||||
|
||||
// Errors can result in corrupt polyhedrons, so put back the old one
|
||||
target = src;
|
||||
|
@ -156,9 +156,9 @@ namespace CGALUtils {
|
|||
newN.p3.reset(new CGAL_Nef_polyhedron3(N.p3->intersection(xy_plane, CGAL_Nef_polyhedron3::PLANE_ONLY)));
|
||||
}
|
||||
catch (const CGAL::Failure_exception &e) {
|
||||
PRINTB("CGALUtils::project during plane intersection: %s", e.what());
|
||||
PRINTB(_("CGALUtils::project during plane intersection: %s"), e.what());
|
||||
try {
|
||||
PRINT("Trying alternative intersection using very large thin box: ");
|
||||
PRINT(_("Trying alternative intersection using very large thin box: "));
|
||||
std::vector<CGAL_Point_3> pts;
|
||||
// dont use z of 0. there are bugs in CGAL.
|
||||
double inf = 1e8;
|
||||
|
@ -173,13 +173,13 @@ namespace CGALUtils {
|
|||
newN.p3.reset(new CGAL_Nef_polyhedron3(nef_bigbox.intersection(*N.p3)));
|
||||
}
|
||||
catch (const CGAL::Failure_exception &e) {
|
||||
PRINTB("CGAL error in CGALUtils::project during bigbox intersection: %s", e.what());
|
||||
PRINTB(_("CGAL error in CGALUtils::project during bigbox intersection: %s"), e.what());
|
||||
}
|
||||
}
|
||||
|
||||
if (!newN.p3 || newN.p3->is_empty()) {
|
||||
CGAL::set_error_behaviour(old_behaviour);
|
||||
PRINT("WARNING: projection() failed.");
|
||||
PRINT(_("WARNING: projection() failed."));
|
||||
return poly;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ namespace CGALUtils {
|
|||
}
|
||||
poly = convertToPolygon2d(*zremover.output_nefpoly2d);
|
||||
} catch (const CGAL::Failure_exception &e) {
|
||||
PRINTB("CGAL error in CGALUtils::project while flattening: %s", e.what());
|
||||
PRINTB(_("CGAL error in CGALUtils::project while flattening: %s"), e.what());
|
||||
}
|
||||
log << "</svg>\n";
|
||||
|
||||
|
@ -493,7 +493,7 @@ bool deproject( CGAL_Point_2 &p2, projection_t &projection, CGAL_Plane_3 &plane,
|
|||
p3 = *point_test;
|
||||
return false;
|
||||
}
|
||||
PRINT("ERROR: deproject failure");
|
||||
PRINT(_("ERROR: deproject failure"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -579,7 +579,7 @@ projection_t find_good_projection( CGAL_Plane_3 &plane )
|
|||
} else if (min==qxz) {
|
||||
goodproj.plane = XZPLANE;
|
||||
if (sign(plane.b())<0) goodproj.flip = true;
|
||||
} else PRINT("ERROR: failed to find projection");
|
||||
} else PRINT(_("ERROR: failed to find projection"));
|
||||
return goodproj;
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ holding the polygon and it's holes. */
|
|||
bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::vector<CGAL_Polygon_3> &triangles, CGAL_Plane_3 &plane )
|
||||
{
|
||||
if (polygons.size()==1 && polygons[0].size()==3) {
|
||||
PRINT("input polygon has 3 points. shortcut tessellation.");
|
||||
PRINT(_("input polygon has 3 points. shortcut tessellation."));
|
||||
CGAL_Polygon_3 t;
|
||||
t.push_back(polygons[0][2]);
|
||||
t.push_back(polygons[0][1]);
|
||||
|
@ -602,12 +602,12 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
|
|||
CDT cdt;
|
||||
std::map<CDTPoint,CGAL_Point_3> vertmap;
|
||||
|
||||
PRINT("finding good projection");
|
||||
PRINT(_("finding good projection"));
|
||||
projection_t goodproj = find_good_projection( plane );
|
||||
|
||||
PRINTB("plane %s",plane );
|
||||
PRINTB("proj: %i %i",goodproj.plane % goodproj.flip);
|
||||
PRINT("Inserting points and edges into Constrained Delaunay Triangulation");
|
||||
PRINTB(_("plane %s"),plane );
|
||||
PRINTB(_("proj: %i %i"),goodproj.plane % goodproj.flip);
|
||||
PRINT(_("Inserting points and edges into Constrained Delaunay Triangulation"));
|
||||
std::vector< std::vector<CGAL_Point_2> > polygons2d;
|
||||
for (size_t i=0;i<polygons.size();i++) {
|
||||
std::vector<Vertex_handle> vhandles;
|
||||
|
@ -629,14 +629,14 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
|
|||
try {
|
||||
cdt.insert_constraint( vhandles[vindex1], vhandles[vindex2] );
|
||||
} catch (const CGAL::Failure_exception &e) {
|
||||
PRINTB("WARNING: Constraint insertion failure %s", e.what());
|
||||
PRINTB(_("WARNING: Constraint insertion failure %s"), e.what());
|
||||
}
|
||||
CGAL::set_error_behaviour(old_behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
size_t numholes = polygons2d.size()-1;
|
||||
PRINTB("seeding %i holes",numholes);
|
||||
PRINTB(_("seeding %i holes"),numholes);
|
||||
std::list<CDTPoint> list_of_seeds;
|
||||
for (size_t i=1;i<polygons2d.size();i++) {
|
||||
std::vector<CGAL_Point_2> &pgon = polygons2d[i];
|
||||
|
@ -657,16 +657,16 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
|
|||
//PRINTB("seed %s",*li);
|
||||
double x = CGAL::to_double( li->x() );
|
||||
double y = CGAL::to_double( li->y() );
|
||||
PRINTB("seed %f,%f",x%y);
|
||||
PRINTB(_("seed %f,%f"),x%y);
|
||||
}
|
||||
PRINT("seeding done");
|
||||
PRINT(_("seeding done"));
|
||||
|
||||
PRINT( "meshing" );
|
||||
PRINT(_("meshing"));
|
||||
CGAL::refine_Delaunay_mesh_2_without_edge_refinement( cdt,
|
||||
list_of_seeds.begin(), list_of_seeds.end(),
|
||||
DummyCriteria<CDT>() );
|
||||
|
||||
PRINT("meshing done");
|
||||
PRINT(_("meshing done"));
|
||||
// this fails because it calls is_simple and is_simple fails on many
|
||||
// Nef Polyhedron faces
|
||||
//CGAL::Orientation original_orientation =
|
||||
|
@ -687,7 +687,7 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
|
|||
else err = deproject( p2, goodproj, plane, cp2 );
|
||||
if (vertmap.count(p3)) cp3 = vertmap[p3];
|
||||
else err = deproject( p3, goodproj, plane, cp3 );
|
||||
if (err) PRINT("WARNING: 2d->3d deprojection failure");
|
||||
if (err) PRINT(_("WARNING: 2d->3d deprojection failure"));
|
||||
pgon.push_back( cp1 );
|
||||
pgon.push_back( cp2 );
|
||||
pgon.push_back( cp3 );
|
||||
|
@ -695,7 +695,7 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
|
|||
}
|
||||
}
|
||||
|
||||
PRINTB("built %i triangles\n",triangles.size());
|
||||
PRINTB(_("built %i triangles\n"),triangles.size());
|
||||
return err;
|
||||
}
|
||||
/////// Tessellation end
|
||||
|
@ -738,7 +738,7 @@ bool createPolySetFromNefPolyhedron3(const CGAL_Nef_polyhedron3 &N, PolySet &ps)
|
|||
bool err = tessellate_3d_face_with_holes( polygons, triangles, plane );
|
||||
if (!err) for (size_t i=0;i<triangles.size();i++) {
|
||||
if (triangles[i].size()!=3) {
|
||||
PRINT("WARNING: triangle doesn't have 3 points. skipping");
|
||||
PRINT(_("WARNING: triangle doesn't have 3 points. skipping"));
|
||||
continue;
|
||||
}
|
||||
ps.append_poly();
|
||||
|
@ -1018,11 +1018,11 @@ static CGAL_Nef_polyhedron *createNefPolyhedronFromPolySet(const PolySet &ps)
|
|||
catch (const CGAL::Assertion_exception &e) {
|
||||
if (std::string(e.what()).find("Plane_constructor")!=std::string::npos) {
|
||||
if (std::string(e.what()).find("has_on")!=std::string::npos) {
|
||||
PRINT("PolySet has nonplanar faces. Attempting alternate construction");
|
||||
PRINT(_("PolySet has nonplanar faces. Attempting alternate construction"));
|
||||
plane_error=true;
|
||||
}
|
||||
} else {
|
||||
PRINTB("CGAL error in CGAL_Nef_polyhedron3(): %s", e.what());
|
||||
PRINTB(_("CGAL error in CGAL_Nef_polyhedron3(): %s"), e.what());
|
||||
}
|
||||
}
|
||||
if (plane_error) try {
|
||||
|
@ -1033,7 +1033,7 @@ static CGAL_Nef_polyhedron *createNefPolyhedronFromPolySet(const PolySet &ps)
|
|||
if (!err) N = new CGAL_Nef_polyhedron3(P);
|
||||
}
|
||||
catch (const CGAL::Assertion_exception &e) {
|
||||
PRINTB("Alternate construction failed. CGAL error in CGAL_Nef_polyhedron3(): %s", e.what());
|
||||
PRINTB(_("Alternate construction failed. CGAL error in CGAL_Nef_polyhedron3(): %s"), e.what());
|
||||
}
|
||||
CGAL::set_error_behaviour(old_behaviour);
|
||||
return new CGAL_Nef_polyhedron(N);
|
||||
|
|
|
@ -222,7 +222,7 @@ void export_off(const class PolySet &ps, std::ostream &output)
|
|||
void export_off(const CGAL_Nef_polyhedron *root_N, std::ostream &output)
|
||||
{
|
||||
if (!root_N->p3->is_simple()) {
|
||||
PRINT("Object isn't a valid 2-manifold! Modify your design.\n");
|
||||
PRINT(_("Object isn't a valid 2-manifold! Modify your design.\n"));
|
||||
}
|
||||
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
|
||||
try {
|
||||
|
|
|
@ -163,7 +163,7 @@ Value Expression::evaluate(const Context *context) const
|
|||
if (this->type == "F") {
|
||||
FuncRecursionGuard g(*this);
|
||||
if (g.recursion_detected()) {
|
||||
PRINTB("ERROR: Recursion detected calling function '%s'", this->call_funcname);
|
||||
PRINTB(_("ERROR: Recursion detected calling function '%s'"), this->call_funcname);
|
||||
return Value();
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ Value FileContext::evaluate_function(const std::string &name, const EvalContext
|
|||
ctx.initializeModule(*usedmod);
|
||||
// FIXME: Set document path
|
||||
#if 0 && DEBUG
|
||||
PRINTB("New lib Context for %s func:", name);
|
||||
PRINTB(_("New lib Context for %s func:"), name);
|
||||
ctx.dump(NULL, NULL);
|
||||
#endif
|
||||
return usedmod->scope.functions[name]->evaluate(&ctx, evalctx);
|
||||
|
@ -214,7 +214,7 @@ AbstractNode *FileContext::instantiate_module(const ModuleInstantiation &inst, c
|
|||
ctx.initializeModule(*usedmod);
|
||||
// FIXME: Set document path
|
||||
#if 0 && DEBUG
|
||||
PRINT("New file Context:");
|
||||
PRINT(_("New file Context:"));
|
||||
ctx.dump(NULL, &inst);
|
||||
#endif
|
||||
return usedmod->scope.modules[inst.name()]->instantiate(&ctx, &inst, evalctx);
|
||||
|
|
|
@ -136,7 +136,7 @@ AbstractNode *ModuleInstantiation::evaluate(const Context *ctx) const
|
|||
EvalContext c(ctx, this->arguments, &this->scope);
|
||||
|
||||
#if 0 && DEBUG
|
||||
PRINT("New eval ctx:");
|
||||
PRINT(_("New eval ctx:"));
|
||||
c.dump(NULL, this);
|
||||
#endif
|
||||
AbstractNode *node = ctx->instantiate_module(*this, &c); // Passes c as evalctx
|
||||
|
|
|
@ -512,7 +512,7 @@ Geometry *PrimitiveNode::createGeometry() const
|
|||
double px, py, pz;
|
||||
if (!this->points.toVector()[pt].getVec3(px, py, pz) ||
|
||||
isinf(px) || isinf(py) || isinf(pz)) {
|
||||
PRINTB("ERROR: Unable to convert point at index %d to a vec3 of numbers", j);
|
||||
PRINTB(_("ERROR: Unable to convert point at index %d to a vec3 of numbers"), j);
|
||||
delete p;
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue