Makelangelo update #44
Shop › Forum › Makelangelo Polargraph Art Robot › Makelangelo update #44
- This topic is empty.
-
AuthorPosts
-
2014-06-17 at 04:26 #6658AnonymousInactive
Yeah I put in 500 500 and it changed it. Looks like a rounding error.
problem at line 178 in MachineConfiguration.java maybe?
float pwf = Math.round( Float.valueOf(pw.getText()) * 100 ) / (100 * 10);
float phf = Math.round( Float.valueOf(ph.getText()) * 100 ) / (100 * 10);
float mwf = Math.round( Float.valueOf(mw.getText()) * 100 ) / (100 * 10);
float mhf = Math.round( Float.valueOf(mh.getText()) * 100 ) / (100 * 10);Seems to round to the tens place.
EDIT: no it truncates the ones place it does not round. Need to do real division not integer division.
2014-06-17 at 04:47 #6659AnonymousInactiveI changed the variables to double instead of floats (and their garbage division) and divided by a real number. Not sure if you needed to be float?
double pwf = Math.round( Float.valueOf(pw.getText()) * 100 ) / (100.0 * 10);
double phf = Math.round( Float.valueOf(ph.getText()) * 100 ) / (100.0 * 10);
double mwf = Math.round( Float.valueOf(mw.getText()) * 100 ) / (100.0 * 10);
double mhf = Math.round( Float.valueOf(mh.getText()) * 100 ) / (100.0 * 10);OR since we lost memory space by making them doubles (128 bits more for 4 numbers) we can optimize speed by changing division to multiplication LOL
double pwf = Math.round( Double.valueOf(pw.getText()) * 100 ) * (.001);
double phf = Math.round( Double.valueOf(ph.getText()) * 100 ) * (.001);
double mwf = Math.round( Double.valueOf(mw.getText()) * 100 ) * (.001);
double mhf = Math.round( Double.valueOf(mh.getText()) * 100 ) * (.001);School is out for this teacher… so bored 😀
2014-06-17 at 19:49 #6660AnonymousInactive@pkm wrote:
I just looked at it. Here’s new start32.bat file, please check on Windows 32bit. Works for me on Windows 64bit 🙂
:: special thanks to http://rgagnon.com/javadetails/java-0642.html
:: http://stackoverflow.com/questions/638301/discover-from-a-batch-file-where-is-java-installed
@echo off
cls
setlocal ENABLEEXTENSIONS
::
:: get the current java version
::
:CheckOS
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64bit) ELSE (GOTO 32bit)
:64bit
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareWow6432NodeJavaSoftJava Runtime Environment" /v CurrentVersion') DO set CurVer=%%B
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareWow6432NodeJavaSoftJava Runtime Environment%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B
GOTO endos
:32bit
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareJavaSoftJava Runtime Environment" /v CurrentVersion') DO set CurVer=%%B
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareJavaSoftJava Runtime Environment%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B
:endos
if defined JAVA_HOME (
@echo The current Java runtime is %CurVer%
) else (
@echo Java not found.
@pause
goto end
)
"%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=32 -jar Makelangelo.jar
:endPlease note that I also moved @pause so that the command prompt window does not remain after the software is closed
(it was pretty annoying).Thank you! Not sure how to test this before I share it with everyone.
2014-06-17 at 20:24 #6661AnonymousInactiveI only added a check for Win 64bit, now it starts the software from both 32bit and 64bit apps, i.e. problem solved.
For Win 32bit there was no problem, I’m 99% sure it won’t appear. Though I’ll try to find a PC with Win 32bit to check.
2014-06-17 at 22:29 #6662AnonymousInactiveI see on the last line it says
"%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=32 -jar Makelangelo.jar
but for 64 bit systems is should be
"%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=64 -jar Makelangelo.jar
2014-06-18 at 11:09 #6663AnonymousInactiveMy guess is start32 for java32 and start64 is for java64.
The problem is Windows 64bit can have java 32 or 64 or both installed.
New start32.bat correctly finds and starts java32 on Windows 64bit from both 32bit or 64bit app.And start64.bat launches java64 on Windows 64 bit, that’s no problem.
Though! Actually start64 won’t launch from 32bit app on Windows 64 (rare situation), I should correct it too.2014-06-18 at 11:54 #6664AnonymousInactiveOr, should I write the only file start.bat?
Which launches java32 on win32, for win64 tries to find java64, then java32.2014-06-18 at 15:55 #6665AnonymousInactiveIn a perfect world we wouldn’t need bat files or that start.command for OSX. It would be as easy as Minecraft – an executable that *just runs* and downloads updated jars automatically.
No idea how to do that.
2014-06-18 at 18:27 #6666AnonymousInactiveI actually have no clue, but there are a few things to try
http://stackoverflow.com/questions/2011664/compiling-a-java-program-into-an-exe2014-06-18 at 18:42 #6667AnonymousInactiveLooking at http://izpack.org/documentation/izpack-utils.html right now. Hmm…
2014-06-20 at 12:10 #6668AnonymousInactiveAny option to remove “Makelangelo #” text below the drawing?
2014-06-20 at 16:49 #6669AnonymousInactiveMore about text:
1. “Text to GCODE” worked for me, but the software won’t open a text file.
2. If I made Cyrillic gcodes, would it convert Cyrillic texts?Also, is it possible to move “Open file” to upper level? It’s hard to find and hard to choose.
Thanks!
2014-06-20 at 17:53 #6670AnonymousInactiveUsually at a show I’m doing the same pictures over and over so I pick from the top ten menu.
How’s this instead?The text to GCode system isn’t that sophisticated yet. In theory someone could use
and
http://docs.oracle.com/javase/7/docs/api/java/awt/font/GlyphVector.html#getOutline%28%29
and
and
to get the lines needed to draw any character in any font. Then someone would also have to write code to handle
SEG_MOVETO
SEG_LINETO
SEG_QUADTO
SEG_CUBICTO
SEG_CLOSE(see last link)
Another way might be to save your text from Inkscape as an R12 DXF and then write a plugin to convert R12 DXF files to GCODE. That way Makelangelo could piggy back on the power of many other art programs.
Recently I’ve been working on gearboxes for the robot arm
https://www.marginallyclever.com/other/hypocycloid-generator.html
and I learned how to read/write R12 DXF files
http://www.mediatel.lu/workshop/graphic/3D_fileformat/h_dxf12.html
You might also find the information useful.
I can’t promise I’ll add either of these ideas any time soon, but if you write a plugin that works I would be delighted to pop it in and make sure you get full credit for your work.
-
AuthorPosts
- You must be logged in to reply to this topic.