IMAGINARY / SURFER

Sources of Java version of SURFER (which uses JavaFX 1.3.1)
http://imaginary.org/program/surfer/
31 stars 6 forks source link

Surfer crashes while typing xx into the equation field #21

Closed andreasdanielmatt closed 8 years ago

andreasdanielmatt commented 8 years ago

First: it all worked perfectly with the building of SURFER (new version), amazing! And to prove it, I hereby commit my first issue: I was playing with equations in the equation bnar (typing via keyboard) and saw that when you type xx or yy the surface does not get greyed out, and it would then crash. Find the error message below (when you type xx+y).

java.lang.UnsupportedOperationException: no value has been assigned to parameter 'xx' at de.mfo.jsurf.algebra.Expand.visit(Expand.java:97) at de.mfo.jsurf.algebra.Expand.visit(Expand.java:19) at de.mfo.jsurf.algebra.DoubleVariable.accept(DoubleVariable.java:30) at de.mfo.jsurf.algebra.Expand.visit(Expand.java:30) at de.mfo.jsurf.algebra.Expand.visit(Expand.java:19) at de.mfo.jsurf.algebra.PolynomialAddition.accept(PolynomialAddition.java:32) at de.mfo.jsurf.algebra.TransformedPolynomialRowSubstitutor.(TransformedPolynomialRowSubstitutor.java:35) at de.mfo.jsurf.rendering.cpu.CPUAlgebraicSurfaceRenderer.collectDrawCallStaticData(CPUAlgebraicSurfaceRenderer.java:91) at de.mfo.jsurf.rendering.cpu.CPUAlgebraicSurfaceRendererExt.collectDrawCallStaticDataExt(CPUAlgebraicSurfaceRendererExt.java:33) at de.mfo.surfer.control.RenderingTask.scheduled(RenderArea.java:731) at javafx.concurrent.Task.setState(Task.java:720) at javafx.concurrent.Task$TaskCallable.lambda$call$499(Task.java:1418) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

porst17 commented 8 years ago

Great! I am really looking forward to having our showcase project fully open source, properly licensed and easy to build. It is a long way to go, but worth it in my opinion.

The error is triggered because jsurf interprets xx as a parameter. But no value has been assigned to it and therefore rendering is not possible.

I implemented a fix for this bug and several related side effects. Using other parameters then a, b, c and d will now properly shown as an error in the formula to the user. Other parameters can still be used in the .jsurffile. I.e. you can use PI if you want to, but you need to initialize it in the .jsurf file to 3.1415.... since there is no way to initialize it in the user interface of SURFER.