improved embedded_space diagnostic help text

This commit is contained in:
Zeno Rogue 2023-01-07 23:21:03 +01:00
parent 4351f99432
commit 351ef88df7
2 changed files with 42 additions and 10 deletions

View File

@ -2248,8 +2248,40 @@ EX geom3::eSpatialEmbedding shown_spatial_embedding() {
EX bool in_tpp() { return pmodel == mdDisk && pconf.camera_angle; }
EX void display_embedded_errors() {
if(meuclid && among(geom3::spatial_embedding, geom3::seNil, geom3::seSol, geom3::seSolN, geom3::seNIH) && (!among(geometry, gEuclid, gEuclidSquare) || !PURE))
dialog::addInfo(XLAT("error: works only in PURE Euclidean regular square or hex tiling"), 0xC00000);
using namespace geom3;
if(meuclid && among(spatial_embedding, seNil, seSol, seSolN, seNIH, seProductH, seProductS, seCliffordTorus, seSL2) && (!among(geometry, gEuclid, gEuclidSquare) || !PURE)) {
dialog::addInfo(XLAT("error: currently works only in PURE Euclidean regular square or hex tiling"), 0xC00000);
return;
}
if(mhyperbolic && among(spatial_embedding, seSol, seSolN, seNIH) && !bt::in()) {
dialog::addInfo(XLAT("error: currently works only in binary tiling and similar"), 0xC00000);
return;
}
if(meuclid && spatial_embedding == seCliffordTorus) {
rug::clifford_torus ct;
ld h = ct.xh | ct.yh;
bool err = sqhypot_d(2, ct.xh) < 1e-3 || sqhypot_d(2, ct.yh) < 1e-3 || abs(h) > 1e-3;
if(err) {
dialog::addInfo(XLAT("error: this method works only in rectangular torus"), 0xC00000);
return;
}
}
if(meuclid && spatial_embedding == seProductS) {
rug::clifford_torus ct;
bool err = sqhypot_d(2, ct.xh) < 1e-3 && sqhypot_d(2, ct.yh) < 1e-3;
if(err) {
dialog::addInfo(XLAT("error: this method works only in cylinder"), 0xC00000);
return;
}
}
if(msphere && !among(spatial_embedding, seNone, seDefault, seLowerCurvature, seMuchLowerCurvature, seProduct, seProductS)) {
dialog::addInfo(XLAT("error: this method does not work in spherical geometry"), 0xC00000);
return;
}
if(mhyperbolic && !among(spatial_embedding, seNone, seDefault, seLowerCurvature, seMuchLowerCurvature, seProduct, seProductH, seSol, seSolN, seNIH)) {
dialog::addInfo(XLAT("error: this method does not work in hyperbolic geometry"), 0xC00000);
return;
}
}
EX void show_spatial_embedding() {

View File

@ -1130,14 +1130,14 @@ EX namespace geom3 {
{"lower curvature", "Embed as a surface in a space of lower curvature."},
{"much lower curvature", "Embed sphere as a sphere in hyperbolic space."},
{"product", "Add one extra dimension in the Euclidean way."},
{"Nil", "Embed into Nil. Works only with Euclidean. You need to set the variation to Pure."},
{"Sol", "Embed into Sol. Works only with Euclidean. You need to set the variation to Pure."},
{"stretched hyperbolic", "Embed into stretched hyperbolic geometry. Works only with Euclidean. You need to set the variation to Pure."},
{"stretched Sol", "Embed into stretched Sol geometry. Works only with Euclidean. You need to set the variation to Pure."},
{"Clifford Torus", "Embed Euclidean torus into S3. You need to set the variation to Pure."},
{"hyperbolic product", "embed Euclidean or hyperbolic plane in the H2xR product space. For E2, set the variation to Pure."},
{"spherical product", "embed Euclidean or spherical plane in the H2xR product space. For E2, set the variation to Pure."},
{"SL(2,R)", "Embed Euclidean plane in twisted product geometry. Set the variation to Pure."}
{"Nil", "Embed Euclidean plane into Nil."},
{"Sol", "Embed Euclidean or hyperbolic plane into Sol."},
{"stretched hyperbolic", "Embed Euclidean or hyperbolic plane into stretched hyperbolic geometry."},
{"stretched Sol", "Embed Euclidean or hyperbolic plane into stretched Sol geometry."},
{"Clifford Torus", "Embed Euclidean rectangular torus into S3."},
{"hyperbolic product", "Embed Euclidean or hyperbolic plane in the H2xR product space."},
{"spherical product", "Embed Euclidean cylinder or spherical plane in the H2xR product space."},
{"SL(2,R)", "Embed Euclidean plane in twisted product geometry."}
};
EX eSpatialEmbedding spatial_embedding = seDefault;