Posts

Steps for using python code with GraalPY and X3DJSAIL

I  just discovered that x3dpsail.py could not be downloaded from a X3DJSONLD 12,  here:   https://coderextreme.net/X3DJSONLD/src/main/html/responsive.html So I am making it available here: https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/graalpy/net/coderextreme/data/x3dpsail.py This is for use with GraalVM’s GraalPy, available here: https://github.com/oracle/graalpython/releases/tag/graal-24.2.2 I use this version: graalpy-community-jvm-24.2.2-windows-amd64.zip The JVM is for accessing Java code (X3DJSAIL). Apologies for the oversight.

Progress on JSON array for MFString

  If anyone is questioning whether NavigationInfo.type works with JSON array if strings, please view this page:   https://coderextreme.net/X3DJSONLD/src/main/html/main_viewer.htm l There’s a slew of examples on the top right.  Best viewed on laptop/desktop.  I like the Rubik examples.  The navigation type switcher is available with RMB on X_ITE and keystrokes in X3DOM. So X3DJSONLD works, at least it converts back to XML/DOM ok. Please show a case where XML MFString is preferred over a native JSON array.  With X3D JSON schema or XML schema, we can insure that all elements of the JSON array are strings. I will work on incorporating Ajv schema validation into X3DJSONLD 12.  That’s a missing piece.   It was present in X3DJSONLD 11.  So now’s your chance to break my app! Thanks! John

Mutable List of Float, Immutable List of Float, Revisited

 This code seems to work! package net.coderextreme; import java.util.ArrayList; import java.util.List; import java.util.Arrays; import java.util.Collections; import java.lang.Float; public class NoModFloatArray { public  static final List<Float> FIELDOFVIEW_DEFAULT_VALUE = Collections.unmodifiableList(List.of(-1f,-1f,1f,1f)); public void print(String section, List<Float> MOD_FIELDOFVIEW) { System.out.println(); System.out.println(section); System.out.println("Immutable Array FIELDOFVIEW_DEFAULT_VALUE "+FIELDOFVIEW_DEFAULT_VALUE); System.out.println("Mutable Array MOD_FIELDOFVIEW"+MOD_FIELDOFVIEW); System.out.println("Compare mutable to immutable "+MOD_FIELDOFVIEW.equals(FIELDOFVIEW_DEFAULT_VALUE)); System.out.println(); } public NoModFloatArray() { List<Float> MOD_FIELDOFVIEW = new ArrayList<Float>(FIELDOFVIEW_DEFAULT_VALUE); print("Modify Pre Immutable Change", MOD_FIELDOFVIEW); try { ...

Mutable List of Float, Immutable List of Float

This code fails to maintain the integrity of the default value. package net.coderextreme; import java.util.ArrayList; import java.util.List; import java.util.Arrays; import java.util.Collections; import java.lang.Float; public class NoModFloatArray { private static final ArrayList<Float> FLOAT_ARRAY_FIELDOFVIEW_DEFAULT_VALUE = new ArrayList<Float>(Arrays.asList(-1f,-1f,1f,1f)); public  static final List<Float> FIELDOFVIEW_DEFAULT_VALUE = Collections.unmodifiableList(FLOAT_ARRAY_FIELDOFVIEW_DEFAULT_VALUE); public void print(String section, List<Float> MOD_FIELDOFVIEW) { System.out.println(); System.out.println(section); System.out.println("Immutable Array FIELDOFVIEW_DEFAULT_VALUE "+FIELDOFVIEW_DEFAULT_VALUE); System.out.println("Mutable Array MOD_FIELDOFVIEW"+MOD_FIELDOFVIEW); System.out.println("Compare mutable to immutable "+MOD_FIELDOFVIEW.equals(FIELDOFVIEW_DEFAULT_VALUE)); System.out.println(); } pub...

Mutable double Arrays, Immutable List of Double in Java

Demo of mutable double arrays an immutable Double Lists. Works, AFAICT package net.coderextreme; import java.util.ArrayList; import java.util.List; import java.util.Arrays; import java.util.Collections; import java.lang.Double; public class NoModDoubleArray { private static final double[] DOUBLE_ARRAY_FIELDOFVIEW_DEFAULT_VALUE = new double [] {-1f,-1f,1f,1f}; public static final List<Double> FIELDOFVIEW_DEFAULT_VALUE = Collections.unmodifiableList(Arrays.asList(Arrays.stream(DOUBLE_ARRAY_FIELDOFVIEW_DEFAULT_VALUE).boxed().toArray(Double[]::new))); public void print(String section, List<Double> MOD_FIELDOFVIEW) { System.out.println(); System.out.println(section); System.out.println("Immutable Array FIELDOFVIEW_DEFAULT_VALUE "+FIELDOFVIEW_DEFAULT_VALUE); System.out.println("Mutable Array MOD_FIELDOFVIEW"+MOD_FIELDOFVIEW); System.out.println("Compare mutable to immutable "+MOD_FIELDOFVIEW.equals(FIELDOFVIEW_DEFAULT_VALUE)); ...

Meaning of Ex3D Lax

This is merely my exile blog from the X3D-public mailing list.  I may cross-post occasionally, but this blog is designed for composing many messages together and posting a single, coherent message.