My client has a 3D AutoCad DWG file of a structure that I'd like to import, display in Java3D and interact with as part of a larger program.
So I'm wondering what to convert the DWG to for easy import and whether Java code exists to display it.
I've got experience using Java3D to render models of the seabed but am not an expert. Currently my software imports 2D WMF files but the client wants 3D.
Thanks for your help :-)
The Forge Viewer can be embedded on a browser control on your app. It works for 2D and 3D.
I solved my problem. I used ABViewer to convert the DWG file to an STL file. Then I used the org.j3d STLFileLoader to load it into my code. This post set me on the right track:
http://forum.jogamp.org/STLLoader-td4032481.html
STLFileLoader seems efficient, it loads a 22Mb model in under a second on my fairly slow PC.
Related
I was wondering what tool can I use to make a single slice (image) into 3D. I can open dicom and raw images in my program but I want to display these images in 3D (just a single image rather than the whole stack). I used some of ImageJ files to open images but I don't like how ImageJ displays the stack in 3D and it doesn't really display a single image in 3d. My program is coded in java and I would like a tool that can be easily integrated into eclipse Kepler. I have found many tools like jogl, java 3d, java 3d workbench, vtk, etc. but I don't know which one to use or are there any other programs that are easier to use or integrate into the system.
EDIT:
I want to do something like this... http://www.welfenlab.de/fileadmin/forschung/gebiete/YaDiV/2008_07_18_Screenshot_YaDiV_1.png
There's a library called ImageJ which can be used to create three-dimensional models from two-dimensional slices. I haven't personally used it, but it looks like it should do the trick.
have you looked at XTK? in particular, lesson 17 seems to be exactly what you are looking for. it is in Javascript, so to integrate into your Java application, you should be able to use one of the many Java/Javascript bridges out there.
Couldn't find a solution on google or here at stackoverflow ...
Anyone knows how can a I handle ESRI shapefiles in android? I'm trying to build a simple shape viewer (for now it's not necessary to write/create shp), and maybe later overlap the maps on top of google maps on android.
So far I tried openMaps and GeoTools, but with no success. Reading the shapefile and store it inside a SQLite database is also interesting! In fact, so far what I'm doing right now is converting the shapefile to a CSV (outside android, in a computer) and then reading the CSV to SQLite for later reading inside the App.
But it would be very interesting if I could read directly from shape to SQLite (or Shape -> csv -> SQLite) using only android.
Any ideas how can I do that? I don't have much experience with Java.
I would recommend making use of Shapelib, which is part of GDAL/OGR. You will need to use the NDK but GDAL is an excellent library with a great community / support and used by many programs.
I made a quick demo to write / append to a shapefile, which should be a sufficient starting point. Please fork the demo if you would like to enhance it for your needs.
I've been talking with an artist and she is planning to send me .ai files for a project I'm working on that is using Java for its front end. Unfortunately, I'm having a lot of trouble searching for this issue because search engines are replacing .ai with "a" (even when I specifically say not to) or are searching for artificial intelligence. Obviously neither of those are what I'm looking for.
Is anyone aware of a Java library capable of rendering .ai files as static images?
.ai file are vector graphics, they shouldn't be used in production. When the final copy of your image is ready your artist should be sending you a .png / .jpg or similar end working file.
.ai stands for Adobe Illustrator and are intended for use only by Illustrator. It's like a developer creating .java files and sending them to a client, it's more likely they'd want a executable jar or a program installer.
Worst case scenario you should install CS5.5 (there's a trial version) and exporting the .ai files to a static file type yourself.
We have a java web application. The application generates a big image with company structure diagramm on it as jpeg. Users download the image and want to print it on DIN A2 (big paper format). The jpeg in this scale has pretty bad quality after printing.
Our idea is to generate an image in vector graphics. What vector graphics format suits the best our needs, considering that we code in java and the users have windows and use MS IE browser?
May be there is a better way archieve this? Like let the browser to display the image and let users to print the page?
PDF has been invented exactly for the same purpose. iText library enables you to draw lines, boxes, circles and insert whatever text you like. If you want to automate it a bit using templates there's JasperReports which utilizes iText.
A well known vector graphics format is Scalable Vector Graphics. It's basically an XML file (starting with <svg> tag. It can be viewed in browsers like Firefox without additional plugins.
For java, you can use the Java 2D API to create SVG format. A tutorial can be found here:
If you need the vector graphic for IE you need VML, similar to SVG but can be rendered by Internet Explorer.
RaphaelJS can be used for vector graphics independent of browser model but it's client side and you may not want to do client side processing on every page load.
I'm trying to create an automated "spider diagram" like the ones created by VUE:
http://vue.tufts.edu/
VUE is open source, but the issue is that you create the maps in the program. I want to have a program that will pull the data from an excel sheet and display the map automatically when run.
I know how to open and parse the data in files, so reading the file isn't the issue. I can program the behavior of how I want everything to "link up", but I just don't want to have to create an applet, then develop the software from scratch.
If I made anything unclear, let me know. I'm very tired today, so it's difficult to stay focused very long.
Many thanks!
-Justian
JGraph is a library to do that. You give it the node and edges and it figures out how to present them in a meaningful way. It is kind of like using graphviz but in Java.
For visualization of production runs we use graphviz out of process and show the images generated from that. It works fine, but a single process solution would be better.
Reading an excel as CSV should be straightforward. POI allows you to read directly the Excel files.