[vtkusers] Is VTK applicable to a CAD like program?

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Wed Aug 20 17:59:43 EDT 2003


Hi Aaron,
   interesting problem, I am not sure vtk can do what you want, although I
have never worked with textures... so take what follows with plenty of
salt...
If you just want to attach different textures to 3D models the answer is
yes, although there will be a bit of effort to understand and correctly
manipulate texture coordinates to get the desired placement. If you want to
actually etch the surface of the models, ie deform the geometry, this may
be possible if you can dive into the C++ code and cut and paste existing
bits of functionality into a class to do it.

-If you want to pursue this read up on textures and texture coordinates:
point your browser at:
http://public.kitware.com/VTK/doc/release/4.0/html/classes.html and search
on the page for 'Texture'
-It is up to you to segment the different parts of the model. Seperate
pieces (polydata), each mapped to a seperate vtk Actor, each with its own
texture (possibly blank) is probably the way to go.
-I have a suspicion there may be a limit of 1 texture per actor in vtk, so
1 actor per part would avoid this limit. Assign each part a texture, then
let the user modify it...
-to actually deform (etch) the model surfaces: vtkWarp* classes might do
something useful, but I suspect you would have to make a new class that
does exactly what they do but using texture as input... ie a new class
'vtkWarpTexture'... start with vtlWarpScalar, find the bit where it gets a
scalar and change it to get a scalar from a texture via a texture
coordinate... However for your application this implies the model surface
would need very high point density to reproduce an etched line... perhaps a
class that creates sufficient new polygons to reproduce the new surface...
(search the web for 'offset surfaces')...

  regards
      Dave Pont




                                                                                                                                                 
                    Aaron Linnen                                                                                                                 
                    <alinnen at global       To:     vtkusers at vtk.org                                                                               
                    kiosk.com>            cc:                                                                                                    
                    Sent by:              Subject:     [vtkusers] Is VTK applicable to a CAD like program?                                       
                    vtkusers-admin@                                                                                                              
                    vtk.org                                                                                                                      
                                                                                                                                                 
                                                                                                                                                 
                    20/08/2003                                                                                                                   
                    10:40                                                                                                                        
                                                                                                                                                 
                                                                                                                                                 




I'm hoping to pick your brains about a software that I'm currently
working on, for any ideas and for where VTK might fit in best.

The program is a domain specific CAD like program for the design of
etched stonework, mostly monuments. The program has a  collection of
elements (line drawings) that can be placed on the stone,  as well as
allowing text items to be created and edited.

The program has been in use for a number of years and the current design
simply lets you edit the main surfaces of the stone as a flat surface,
then has a (hand written, and poorly at that) perspective view.  The
program currently doesn't hand more complicated stones (e.g. made out
of  several stones, or oddly shaped with curves)

It was in looking to rewrite and improve the perspective view that I
started looking into VTK.  To make use of  it, I would need to make
actual 3d models for the various stones.  Looking into this I had the
idea that maybe VTK could help with the editing portion too.

My rough idea was if I was making the the 3d models anyways, I should be
able to get VTK to generate the shape of the various surfaces that I
could use as textures for the 3d view. So the editing would be on the 2d
texture maps for now and not need much training for the users.

So I'm wondering if given a shape, say a stone vase with 2 flat sides
front and back and 2 rounded sides, looking like this in a top down view:
 ___
(___)   (please excuse my feeble attempts at ASCII art!)
  a) can I tag the 3d model data so that I know which polygons compose
each of the 4 sides? What file format handles this nicely?
  b) can I get the texture shape needed for each of the sides (which may
be composed of several polygons)
  c) would there be a way to handle pictures that wrap one 2 (or more)
of the sides?
  d) what if this vase had a top that can also be engraved? Now a) needs
to be able to mark 5 sides, c) potentially might need to wrap something
on the front, top and right side for example.
   e) is there an accurate method of knowing where something is on the
texture maps to on the 3d model? Say I needed to add a border exactly 1
inch from the top of the vase?

Well, as usual, writing it out has helped my already. If anyone has
pointers or ideas on this it would be great. Particular parts of VTK
that would apply would be appreciated too.  Completely different methods
are also welcomed :)

If this is deemed too of topic for this list, I apologize and people can
follow up off-list if that's more appropriate.

Thanks,
Aaron



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers







More information about the vtkusers mailing list