[vtkusers] unstructured triangles grid

ALI AWARKI aawarki14 at yahoo.com
Thu Jul 21 14:16:37 EDT 2005


hi everybody,
 
i am new to vtk and i am trying to build a 2D  unstructured grid that represents a beam made of 8 triangles and 10 points.
i have already built a 3D  unstructured grid using hexahedrons and  things worked quite fine. On the other hands i always get an errror saying " nameofmyfile.exe has encountered a problem and needs to close". i am almost sure that nothing is wrong with the code which goes as follows:
// points coordinates
 static float coord[10][3]=
 { 
  {0,0,0},
  {1,0,0},
  {2,0,0},
  {3,0,0},
  {4,0,0},
  {0,1,0},
  {1,1,0},
  {2,1,0},
  {3,1,0},
  {4,1,0}};
 
// Cells connectivity
vtkIdType indices[8][3]=
 {
 {1,2,7},
 {1,7,6},
 {2,3,8},
 {2,8,7},
 {3,4,9},
 {3,9,8},
 {4,5,10},
 {4,10,9}};
 
 
 vtkPoints *pts=vtkPoints::New();
for (int i=0;i<10;i++) 
 pts->InsertPoint(i,coord[i]);
 
vtkUnstructuredGrid *grid=vtkUnstructuredGrid::New();

for ( i=0;i<8;i++) grid->InsertNextCell(VTK_TRIANGLE,10,indices[i]);
grid->SetPoints(pts);
 
vtkDataSetMapper *gridmap =vtkDataSetMapper::New();
gridmap->SetInput(grid);
 
vtkActor *gridact=vtkActor::New();
gridact->SetMapper(gridmap);
 
vtkRenderer *ren1=vtkRenderer::New();
ren1->AddActor(gridact);

vtkRenderWindow *renwin=vtkRenderWindow::New();
renwin->AddRenderer(ren1);

vtkRenderWindowInteractor *renwinint=vtkRenderWindowInteractor::New();
renwinint->SetRenderWindow(renwin);

renwin->Render();
renwinint->Start();
 
the same code worked for the hexahedron. it's kind of strange that is not working for the triangles.
please help.
thx.


vtkusers-request at vtk.org wrote:
Send vtkusers mailing list submissions to
vtkusers at vtk.org

To subscribe or unsubscribe via the World Wide Web, visit
http://www.vtk.org/mailman/listinfo/vtkusers
or, via email, send a message with subject or body 'help' to
vtkusers-request at vtk.org

You can reach the person managing the list at
vtkusers-owner at vtk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of vtkusers digest..."


Today's Topics:

1. Re: Compiling VTK with DevCpp and MinGW (Dimitrios Andritsos)
2. Re: Compiling VTK with DevCpp and MinGW (David Cole)
3. Averaging vtkTransforms (Kevin Wilson)
4. setposition (Louis Desjardins)
5. Offscreen Rendering with Windows (Rene Tschirley)
6. Problem with sampling using vtkProbeFilter (Charles Boivin)


----------------------------------------------------------------------

Message: 1
Date: Wed, 20 Jul 2005 19:23:25 +0300
From: "Dimitrios Andritsos" 
Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW
To: "David Cole" 
Cc: vtkusers at vtk.org
Message-ID: 
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=response

I am using CMake 2.0.6 and I am trying to build vtk 4.4.

I played a little bit with CMakeLists.txt files where I tried to comment 
out any attempts to load support for either tcl, python or java and although 
I didn't get the dll erros I still get an error that the command 
vtk_make_instantiator2 cannot be found. The errors are generated if I 
comment out loading vtkLoadCmakeExtensions and vtkCompileCmakeExtensions. I 
am not a CMake guru so I don't really know how to do such changes.

Dimitris

----- Original Message ----- 
From: "David Cole" 
To: "Dimitrios Andritsos" 
Cc: 
Sent: Wednesday, July 20, 2005 6:57 PM
Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW


> Hmmmm...
>
> So: what version of CMake are you using? (I was assuming latest released 
> or CVS: 2.0.6 or later?)
> What version of VTK are you trying to build?
> I have only built VTK from recent CVS with MinGW. Can you update your VTK 
> to latest CVS?
>
> Dimitrios Andritsos wrote:
>
>> Hello David,
>>
>> Thank you for your reply. I don't need Tcl but I am not really sure how 
>> to turn this option off. The error that I am getting is generated while 
>> CMake tries to configure and generate the initial makefiles, before I get 
>> the option of turning the various wrapping options on or off. Do you know 
>> if I could turn the Tcl wrapping option off even before cmake tries to 
>> configure the makefiles?
>>
>> Thanks a lot,
>> Dimitris
>>
>> ----- Original Message ----- From: "David Cole" 
>> To: "Dimitrios Andritsos" 
>> Cc: 
>> Sent: Wednesday, July 20, 2005 4:44 PM
>> Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW
>>
>>
>>> It sounds like you have VTK_WRAP_TCL turned on. I'm not sure if TCL
>>> wrapping will work from a MinGW compile, unless there's a MinGW
>>> supported version of Tcl/Tk that you can install. You'll need the libs
>>> to link against.
>>>
>>> Has anybody out there done a Tcl wrapped build of VTK under MinGW?
>>>
>>> Do you still get that error if you set VTK_WRAP_TCL to OFF when you
>>> configure with CMakeSetup?
>>> Do you need TCL wrapping?
>>>
>>> HTH a little bit,
>>> David
>>>
>>> Dimitrios Andritsos wrote:
>>>
>>>> Hello all,
>>>> I' ve been trying (unsuccessfully) to build vtk with the mingw 
>>>> compiler in windows. From some previous posts I saw that runing cmake 
>>>> via msys would work but I get an error message that:
>>>> 'LOAD_COMMAND Attempt to load command failed from file: 
>>>> cmVTK_WRAP_TCL2.dll' The process I follow is: 1)Run msys 2)Run 
>>>> cmakesetup (cmake -i is not working) 3)Try to generate unix makefiles.
>>>> My goal is to build *.a lib files and in general build the vtk 
>>>> binaries in unix format to use within the dev-cpp environment.
>>>> Any help would be greatly appreciated.
>>>> Thanks in advance!
>>>> Dimitris
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> _______________________________________________
>>>> This is the private VTK discussion list. Please keep messages on-topic. 
>>>> Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>
>>>
>>
> 


------------------------------

Message: 2
Date: Wed, 20 Jul 2005 12:58:32 -0400
From: David Cole 
Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW
To: Dimitrios Andritsos 
Cc: vtkusers at vtk.org
Message-ID: <42DE82B8.60904 at kitware.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Do you have to use VTK 4.4?

Can you update to the latest VTK from CVS? This does build under MinGW 
with no source code changes. (See evidence at : 
http://www.vtk.org/Testing/Sites/ARRAKIS.kitware/Win32-mingw/20050720-0300-Nightly/Test.html)

If I can make some time to investigate, I'll see if I can figure out a 
patch to apply on top of a VTK 4.4 source tree to allow building with 
MinGW. No promises, though. May not be for a while. If somebody else has 
already done this, please chime in...

Thanks,
David

Dimitrios Andritsos wrote:

> I am using CMake 2.0.6 and I am trying to build vtk 4.4.
>
> I played a little bit with CMakeLists.txt files where I tried to 
> comment out any attempts to load support for either tcl, python or 
> java and although I didn't get the dll erros I still get an error that 
> the command vtk_make_instantiator2 cannot be found. The errors are 
> generated if I comment out loading vtkLoadCmakeExtensions and 
> vtkCompileCmakeExtensions. I am not a CMake guru so I don't really 
> know how to do such changes.
>
> Dimitris
>
> ----- Original Message ----- From: "David Cole" 
> To: "Dimitrios Andritsos" 
> Cc: 
> Sent: Wednesday, July 20, 2005 6:57 PM
> Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW
>
>
>> Hmmmm...
>>
>> So: what version of CMake are you using? (I was assuming latest 
>> released or CVS: 2.0.6 or later?)
>> What version of VTK are you trying to build?
>> I have only built VTK from recent CVS with MinGW. Can you update your 
>> VTK to latest CVS?
>>
>> Dimitrios Andritsos wrote:
>>
>>> Hello David,
>>>
>>> Thank you for your reply. I don't need Tcl but I am not really sure 
>>> how to turn this option off. The error that I am getting is 
>>> generated while CMake tries to configure and generate the initial 
>>> makefiles, before I get the option of turning the various wrapping 
>>> options on or off. Do you know if I could turn the Tcl wrapping 
>>> option off even before cmake tries to configure the makefiles?
>>>
>>> Thanks a lot,
>>> Dimitris
>>>
>>> ----- Original Message ----- From: "David Cole" 
>>> 
>>> To: "Dimitrios Andritsos" 
>>> Cc: 
>>> Sent: Wednesday, July 20, 2005 4:44 PM
>>> Subject: Re: [vtkusers] Compiling VTK with DevCpp and MinGW
>>>
>>>
>>>> It sounds like you have VTK_WRAP_TCL turned on. I'm not sure if TCL
>>>> wrapping will work from a MinGW compile, unless there's a MinGW
>>>> supported version of Tcl/Tk that you can install. You'll need the libs
>>>> to link against.
>>>>
>>>> Has anybody out there done a Tcl wrapped build of VTK under MinGW?
>>>>
>>>> Do you still get that error if you set VTK_WRAP_TCL to OFF when you
>>>> configure with CMakeSetup?
>>>> Do you need TCL wrapping?
>>>>
>>>> HTH a little bit,
>>>> David
>>>>
>>>> Dimitrios Andritsos wrote:
>>>>
>>>>> Hello all,
>>>>> I' ve been trying (unsuccessfully) to build vtk with the mingw 
>>>>> compiler in windows. From some previous posts I saw that runing 
>>>>> cmake via msys would work but I get an error message that:
>>>>> 'LOAD_COMMAND Attempt to load command failed from file: 
>>>>> cmVTK_WRAP_TCL2.dll' The process I follow is: 1)Run msys 2)Run 
>>>>> cmakesetup (cmake -i is not working) 3)Try to generate unix 
>>>>> makefiles.
>>>>> My goal is to build *.a lib files and in general build the vtk 
>>>>> binaries in unix format to use within the dev-cpp environment.
>>>>> Any help would be greatly appreciated.
>>>>> Thanks in advance!
>>>>> Dimitris
>>>>>
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> This is the private VTK discussion list. Please keep messages 
>>>>> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>
>>>>
>>>>
>>>
>>
>


------------------------------

Message: 3
Date: Wed, 20 Jul 2005 13:05:09 -0400
From: "Kevin Wilson" 
Subject: [vtkusers] Averaging vtkTransforms
To: 
Message-ID: 

Content-Type: text/plain; charset="iso-8859-1"

Hi all,

I have about 10 polydata Transforms that I want to average into one
Transform. My question is - is there any easier way to do this that
extracting each rotation and translation and averaging them manually?? I
tried to look at vtkTransformCollection but I didn't see any GetAverage() in
the documentation.

Any Suggestions??

Kevin



------------------------------

Message: 4
Date: Wed, 20 Jul 2005 19:55:43 +0000
From: "Louis Desjardins" 
Subject: [vtkusers] setposition
To: vtkusers at vtk.org
Message-ID: 
Content-Type: text/plain; format=flowed

Hi experts,

just a simple question -

I have a vtkActor2D (a vtkTextActor to be exact) whose position I want to 
set according to its view coordinates (or viewport even). When i use the 
SetPosition() method, this seems to use some other coordinate system 
(because I can set the position to values greater than 1, like 100 for 
instance)

However I have also used a vtkScalarBarActor in my program whose position I 
set using SetPosition and it seems to be working in view coordinates..

So I'm a littel confused as to how I should go about setting my 
vtkTextActor's position, in terms of view (or viewport) coordinates. Maybe 
its not using the SetPosition() mehtod..?

thanks!!
LD




------------------------------

Message: 5
Date: Wed, 20 Jul 2005 22:27:28 +0200
From: Rene Tschirley 

Subject: [vtkusers] Offscreen Rendering with Windows
To: vtkusers at vtk.org
Message-ID: <20050720202728.GC30869 at lava.cs.tu-berlin.de>
Content-Type: text/plain; charset=iso-8859-1

Dear all,


Did anybody try to use offscreen rendering on the Windows OS? As far as I
understand earlier discussions, there is the way to do offscreen
rendering using the Mesa subsystem on the *nix platform as well as a
virtual framebuffer.

I'm curious if there is a significant chance to let VTK render images
which I can then use in my Java application. This has to be as
platform-independent as possible (a compiled VTK-JAR for each target
platform would be bad enough for my project), so I don't even want to use
Cygwin.


Yours,
René

-- 
Dr.-Ing. René Tschirley
http://www.tschirley.com


------------------------------

Message: 6
Date: Wed, 20 Jul 2005 16:46:49 -0600
From: Charles Boivin 
Subject: [vtkusers] Problem with sampling using vtkProbeFilter
To: vtkusers at vtk.org
Message-ID: <60ba95805072015462f0fe7c0 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello all,

I have been using the vtkProbeFilter with an imagedata as a source and
some polydata surface (an isosurface, generated from vtkContourFilter)
as input. The imagedata has point data only. This works relatively
well, except at the edges of my domain. I sometimes get some values
that are arbitrarily set to zero there. I have attached an image
(isosurfaceproblem.png) that shows that problem -- I know for a fact
that the values at the bottom edge should NOT be zero (and should be
smoother than what is shown). The result is very inconsistent -- i.e.
if I change the input isosurface slightly, the location of problem
points on the bottom edge will change. I also sometimes see this
problem appear on other edges.

I have also included an image (slicenoproblem.png) that shows the same
edge, but colored on a vtkImageGeometryDataFilter (i.e. just a
'slice') of the domain. The lookup table for the value displayed is
the same for both. This shows that there is no problem for the bottom
edge...

Anyone have any idea what is going on? Is it possible that
vtkProbeFilter sometimes 'misses' the source data and therefore
outputs 0 at a location? Is there possibly a problem with my input (or
source) data? I am using VTK4.4 on a Windows machine. Source code
built using VS.Net 2003.

Thank you in advance for all ideas/suggestions...

Charles Boivin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isosurfaceproblem.png
Type: image/png
Size: 36960 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/vtkusers/attachments/20050720/a27956a1/isosurfaceproblem.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slicenoproblem.png
Type: image/png
Size: 22639 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/vtkusers/attachments/20050720/a27956a1/slicenoproblem.png

------------------------------

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org
http://www.vtk.org/mailman/listinfo/vtkusers


End of vtkusers Digest, Vol 15, Issue 53
****************************************

		
---------------------------------
 Start your day with Yahoo! - make it your home page 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050721/44aaa55a/attachment.htm>


More information about the vtkusers mailing list