[vtkusers] Problem with vtkContourTriangulator and vtkPlaneCutter
Jeffery Lewis
jlewis at accuray.com
Tue Mar 6 12:00:57 EST 2018
Thank you Andrew for looking into this.
Doing the changes does seem to work. Unfortunately, if you change the resolution of the surface model by adding the following two lines of code...
source->SetPhiResolution(100);
source->SetThetaResolution(100);
...you will see the same type of issues on the filled contour.
Also, if I substitute the vtkPlaneCutter for the vtkCutter using the vtkSuperquadricSource, it crashes in a similar way.
-----Original Message-----
From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of vtkusers-request at vtk.org
Sent: Tuesday, March 06, 2018 4:29 AM
To: vtkusers at vtk.org
Subject: vtkusers Digest, Vol 167, Issue 12
Send vtkusers mailing list submissions to
vtkusers at vtk.org
To subscribe or unsubscribe via the World Wide Web, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_listinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=MWPDDDsPKpMgwMJj4wU5oge7N5g3Nur9iaPwBS295Gs&e=
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: Error reading asci data. Possible mismatch of datasize
with declaration (Amine Aboufirass)
2. Re: Iterate over vtkInformation (Ken Martin)
3. How to triangulate two non-intersecting polylines, now in 3D
(normanius)
4. Re: How to triangulate two non-intersecting polylines, now in
3D (normanius)
5. Re: How to triangulate two non-intersecting polylines, now in
3D (normanius)
6. Re: How to triangulate two non-intersecting polylines, now in
3D (Bill Lorensen)
7. Re: How to triangulate two non-intersecting polylines, now in
3D (normanius)
8. Re: How to triangulate two non-intersecting polylines, now in
3D (normanius)
9. Re: Error reading asci data. Possible mismatch of datasize
with declaration (kenichiro yoshimi)
10. how to replicate the data rendering line between two
vtkresliceimageviewer variables? (=?gb18030?B?0e7B+Lb5x+A=?=)
11. Re: Problem with vtkContourTriangulator and vtkPlaneCutter
(Jeffery Lewis) (Andrew Maclean)
12. Assembly Rotation (Koteswara Rao Ruvva)
13. VTK + Qt in a remote ssh session (Ignacio Fern?ndez Galv?n)
14. Rendering and saving unstructured grid mesh to image file
(Amine Aboufirass)
----------------------------------------------------------------------
Message: 1
Date: Mon, 5 Mar 2018 18:10:21 +0100
From: Amine Aboufirass <amine.aboufirass at gmail.com>
To: Bill Lorensen <bill.lorensen at gmail.com>
Cc: VTK Users <vtkusers at vtk.org>, vtk-developers-request at vtk.org, VTK
Developers <vtk-developers at vtk.org>
Subject: Re: [vtkusers] Error reading asci data. Possible mismatch of
datasize with declaration
Message-ID:
<CAMwawgPHYr3fVdTUTXx5H9J5qJgwoy3c4152-9oGFtMbEuC7ag at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
There are 9 tensor components. It is a true tensor
On Mon, Mar 5, 2018 at 5:56 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:
> Ignore I previous responses. I miscalcuated.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_adaa9298_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=g_YIWJ9oq5HjAd6T7OD_9xX8yajuwVen1TVPH7bzFVI&e=>
------------------------------
Message: 2
Date: Mon, 5 Mar 2018 14:26:04 -0500
From: Ken Martin <ken.martin at kitware.com>
To: Doug Hoppes <dhoppes at mbfbioscience.com>
Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
Subject: Re: [vtkusers] Iterate over vtkInformation
Message-ID:
<CANXz0SbS1-7CCM1HLKnUL=Hng2Ggz42y5-7ivc3Lh8xr9ack1w at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I **think** somehow you have to pass that custom key down to both the code that is inserting the key and the code that is checking if the key exists.
Unless I am missing something I don't think there is anyway around that.
Usually the key is a static defined somewhere and the code that uses it includes the header that defines it.
Hope that helps!
On Wed, Feb 28, 2018 at 11:35 AM, Doug Hoppes <dhoppes at mbfbioscience.com>
wrote:
> Hey all,
>
>
>
> For a vtkprop, I need to set some custom attributes (i.e.
> allowSecureDeletion, etc). So, the main way to do this is to set a
> property key (in a vtkinformation object) and then access the property
> later on.
>
>
>
> The problem is that I need the original custom key
> pointer to access the property. However, I don?t have access to that
> property object since I?m looping through all of the vtkprops and want
> to ask it if the specific property key exists.
>
>
>
> Dougie
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_&d
> =DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rts
> YkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=epnvRQ7HOVR7d
> r1pNmcchM4eLG-93AitCbnvHexf9nk&e=
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_V
> TK-5FFAQ&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTI
> tPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=4vW
> mhE6snubmnh4n3w18s3fAMY84jczAIn076hKXtxo&e=
>
> Search the list archives at:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_searc
> h_-3Fq-3Dvtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgM
> iAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEq
> yHQ&s=A_26bezXudAI1o583GywYuDetkaSQqFX-AERDqviacI&e=
>
> Follow this link to subscribe/unsubscribe:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_l
> istinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMi
> AohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqy
> HQ&s=MWPDDDsPKpMgwMJj4wU5oge7N5g3Nur9iaPwBS295Gs&e=
>
>
--
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_5fc00acc_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=bpLl9j6ac49JqtQLPfda9GbrnDkFJOgMujTOAOxghXU&e=>
------------------------------
Message: 3
Date: Mon, 5 Mar 2018 14:24:14 -0700 (MST)
From: normanius <juch at zhaw.ch>
To: vtkusers at vtk.org
Subject: [vtkusers] How to triangulate two non-intersecting polylines,
now in 3D
Message-ID: <1520285054864-0.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii
Dear all
I've got a follow-up question on this post <https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_How-2Dto-2Dtriangulate-2Dtwo-2Dnon-2Dintersecting-2Dpolylines-2Din-2D2D-2Dtd5746534.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=f3fXMZSu7d0J9Cp_5ZbgztVZnOIQtjbZcfOMdpAEU2I&e=>
.
How can I triangulate two non-intersecting contours that are /not/ lying in the same plane? See the screenshot below that illustrates my problem.
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t341102_Screen-5FShot-5F2018-2D03-2D05-5Fat-5F21.png&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=bpDJt6G8zr2yO1iEOTi2EfDzUVibpEMLeXh-NSpoHhI&e=>
Any ideas?
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=
------------------------------
Message: 4
Date: Mon, 5 Mar 2018 14:29:31 -0700 (MST)
From: normanius <juch at zhaw.ch>
To: vtkusers at vtk.org
Subject: Re: [vtkusers] How to triangulate two non-intersecting
polylines, now in 3D
Message-ID: <1520285371710-0.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii
The contour triangulator that was suggested in my previous post operates only in 2D. So one solution to this problem that came to my mind is that the contours need to be projected into the same plane where the contour triangulation is performed. Then, only the edges from contour need to be "transferred" into a common polydata object. (All this works only if the contours are lying in parallel planes, which is the case for me.)
In simplified code, this would read as
However, this does not work robustly, as shown in this screenshot...
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t341102_Screen-5FShot-5F2018-2D03-2D05-5Fat-5F22.png&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=XbulD8dQM2wj2qIJqrVya72dG2vROZp6BpCBbd9HBsM&e=>
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=
------------------------------
Message: 5
Date: Mon, 5 Mar 2018 14:35:36 -0700 (MST)
From: normanius <juch at zhaw.ch>
To: vtkusers at vtk.org
Subject: Re: [vtkusers] How to triangulate two non-intersecting
polylines, now in 3D
Message-ID: <1520285736914-0.post at n5.nabble.com>
Content-Type: text/plain; charset="us-ascii"
(I think I forgot to set the HTML flag before, now the code should be
visible.)
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_4f127aa1_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ndADvtlKFBioRhbVjxWLaekWwvtF5gC_vc8_BeLpc-Y&e=>
------------------------------
Message: 6
Date: Mon, 5 Mar 2018 14:29:28 -0800
From: Bill Lorensen <bill.lorensen at gmail.com>
To: normanius <juch at zhaw.ch>
Cc: VTK Users <vtkusers at vtk.org>
Subject: Re: [vtkusers] How to triangulate two non-intersecting
polylines, now in 3D
Message-ID:
<CADZJ4hMc7HsCr7Y9gebXLJeRGbX-6dZUsLb5HnM9HSaH2b_V0Q at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
This example may be useful.
https://urldefense.proofpoint.com/v2/url?u=https-3A__lorensen.github.io_VTKExamples_site_Cxx_PolyData_ContoursToSurface_&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=k6WgciejkyjS4qHvcaEB8VBZUJsrKRZ80G4T9z9rjSE&e=
On Mar 5, 2018 1:35 PM, "normanius" <juch at zhaw.ch> wrote:
> (I think I forgot to set the HTML flag before, now the code should be
> visible.)
>
>
> # comboBefore = combinePolyData(edge1, edge2) # center1 =
> computeCenter(edge1) # center2 = computeCenter(edge2) # edge2 =
> scaleObject(edge2, 1.2) # Scaling is required to make sure that the
> contours are not intersecting in 2D # edge2 = moveObject(edge2,
> center1-center2) # comboAfter = combinePolyData(edge1, edge2) result =
> vtk.vtkContourTriangulator()
> result.SetInputData(combo)
> result.Update()
>
> poly = vtk.vtkPolyData()
> poly.SetPoints(comboBefore.GetPoints())
> poly.SetPolys(result.GetPolys())
> poly.BuildLinks()
> poly.BuildCells()
>
>
> ------------------------------
> Sent from the VTK - Users mailing list archive
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=> at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_&d
> =DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rts
> YkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=epnvRQ7HOVR7d
> r1pNmcchM4eLG-93AitCbnvHexf9nk&e=
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_V
> TK-5FFAQ&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTI
> tPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=4vW
> mhE6snubmnh4n3w18s3fAMY84jczAIn076hKXtxo&e=
>
> Search the list archives at:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_searc
> h_-3Fq-3Dvtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgM
> iAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEq
> yHQ&s=A_26bezXudAI1o583GywYuDetkaSQqFX-AERDqviacI&e=
>
> Follow this link to subscribe/unsubscribe:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_l
> istinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMi
> AohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqy
> HQ&s=MWPDDDsPKpMgwMJj4wU5oge7N5g3Nur9iaPwBS295Gs&e=
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_b76addbb_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=VIn3WN03__h8ZdQB-y1EJ1qDzPi944UzLMEsjgV_czE&e=>
------------------------------
Message: 7
Date: Mon, 5 Mar 2018 17:29:48 -0700 (MST)
From: normanius <juch at zhaw.ch>
To: vtkusers at vtk.org
Subject: Re: [vtkusers] How to triangulate two non-intersecting
polylines, now in 3D
Message-ID: <1520296188366-0.post at n5.nabble.com>
Content-Type: text/plain; charset="us-ascii"
Many thanks for the hint, Bill!I found that sample too. However, it is very difficult to create watertight closures with this approach. See what my result looks like. From distance things look okayish. However, if I zoom in, the result does not look good. What can I do to improve?(Here a sketch of my
implementation: https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_kPR1wKv6&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=krhjtGnUcGcFmk9EodBR4FXkBlGcwORi0V_oKapsWnA&e=
<https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_kPR1wKv6&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=krhjtGnUcGcFmk9EodBR4FXkBlGcwORi0V_oKapsWnA&e=> ) <https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t341102_Screen-5FShot-5F2018-2D03-2D06-5Fat-5F01.png&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=zYGvqNmg2zu4R7Gd4tO2VNo2d8WAUixowJZ2F887nLk&e=>
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t341102_Screen-5FShot-5F2018-2D03-2D06-5Fat-5F01.png&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=zYGvqNmg2zu4R7Gd4tO2VNo2d8WAUixowJZ2F887nLk&e=>
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_a2704599_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=AB2KmTMlaGoVc_blj3SWuUoFrOUHBpim1w1EutDHb7Q&e=>
------------------------------
Message: 8
Date: Mon, 5 Mar 2018 17:32:40 -0700 (MST)
From: normanius <juch at zhaw.ch>
To: vtkusers at vtk.org
Subject: Re: [vtkusers] How to triangulate two non-intersecting
polylines, now in 3D
Message-ID: <1520296360148-0.post at n5.nabble.com>
Content-Type: text/plain; charset="us-ascii"
>From far, the result looks okayish...
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t341102_Screen-5FShot-5F2018-2D03-2D06-5Fat-5F01.png&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=zYGvqNmg2zu4R7Gd4tO2VNo2d8WAUixowJZ2F887nLk&e=>
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=ZcXXP5FbvaYCmTevP7gcBfmN_62nJVqZnOFMqzl1aKU&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180305_131e2203_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=5rTCtrkJ2ocUiEK2Ty2iXUMiRFLoKE2yXobgxeP7v00&e=>
------------------------------
Message: 9
Date: Tue, 6 Mar 2018 09:56:19 +0900
From: kenichiro yoshimi <rccm.kyoshimi at gmail.com>
To: Amine Aboufirass <amine.aboufirass at gmail.com>
Cc: Bill Lorensen <bill.lorensen at gmail.com>, VTK Developers
<vtk-developers at vtk.org>, VTK Users <vtkusers at vtk.org>,
vtk-developers-request at vtk.org
Subject: Re: [vtkusers] Error reading asci data. Possible mismatch of
datasize with declaration
Message-ID:
<CAHDyfPBenxA6gtqdzUzhqhS4dh-AZzSfZ+JJ=-=J0gBLrTN2zw at mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hello Amine,
Could you try to replace very small numbers (like
2.778595324927526E-106) with zeros? Overflow or underflow might be
caused by them in a single-precision floating-point numbers.
Thanks
2018-03-06 2:10 GMT+09:00 Amine Aboufirass <amine.aboufirass at gmail.com>:
> There are 9 tensor components. It is a true tensor
>
> On Mon, Mar 5, 2018 at 5:56 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> Ignore I previous responses. I miscalcuated.
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=68iGeE9EI54qfZjkbpoDtnQcVUn_zOQBlUMEtsdtER0&e=
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=4vWmhE6snubmnh4n3w18s3fAMY84jczAIn076hKXtxo&e=
>
> Search the list archives at: https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=A_26bezXudAI1o583GywYuDetkaSQqFX-AERDqviacI&e=
>
> Follow this link to subscribe/unsubscribe:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_listinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=MWPDDDsPKpMgwMJj4wU5oge7N5g3Nur9iaPwBS295Gs&e=
>
------------------------------
Message: 10
Date: Tue, 6 Mar 2018 11:15:22 +0800
From: "=?gb18030?B?0e7B+Lb5x+A=?=" <312438111 at qq.com>
To: "=?gb18030?B?dnRrdXNlcnM=?=" <vtkusers at vtk.org>
Subject: [vtkusers] how to replicate the data rendering line between
two vtkresliceimageviewer variables?
Message-ID: <tencent_2590ACA0B6B55CC1D720F1D1AFA0E9788B0A at qq.com>
Content-Type: text/plain; charset="gb18030"
hello guys,
I want to assign the data from a vtkresliceimageviewer variable to anther ones.If I use "=",it copys the data only.How to replicate the data rendering line between two vtkresliceimageviewer variables? I will be crazy because of that question.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180306_3bc97bde_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=07Qi38RgbExCEz5JlMl034PzRPHR82z2ETzmDwiU-Io&e=>
------------------------------
Message: 11
Date: Tue, 6 Mar 2018 15:24:06 +1100
From: Andrew Maclean <andrew.amaclean at gmail.com>
To: vtk <vtkusers at vtk.org>
Cc: Jeffery Lewis <jlewis at accuray.com>
Subject: Re: [vtkusers] Problem with vtkContourTriangulator and
vtkPlaneCutter (Jeffery Lewis)
Message-ID:
<CAHDsG9Ny9mCJsY4BCetcYowhQdPftzVhPcdspXCSW8nwdyvVhA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Jeffery
?I think this is related to the ParametricFunctions. These functions are
generated by mapping R? -> R? and are then triangulated.
I tried vtkParametricSuperToroid and sometimes the contouring and cutting
worked but in some orientations the triangulation failed.
?If you use a vtkSuperquadricSource e.g:
vtkSmartPointer<vtkSuperquadricSource> source =
vtkSmartPointer<vtkSuperquadricSource>::New();
source->SetCenter(0, 0, 0);
source->SetPhiRoundness(1.0);
source->SetThetaRoundness(1.0);
source->ToroidalOn();
Everything seems to work Ok.
Andrew
> ---------- Forwarded message ----------
> From: Jeffery Lewis <jlewis at accuray.com>
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Cc:
> Bcc:
> Date: Fri, 2 Mar 2018 23:46:09 +0000
> Subject: Re: [vtkusers] Problem with vtkContourTriangulator and
> vtkPlaneCutter (Jeffery Lewis)
> Seems like the attachments didn't go through. Here is the code.
>
> #include <vtkSmartPointer.h>
> #include <vtkParametricSuperToroid.h>
> #include <vtkParametricFunctionSource.h>
> #include <vtkSphereSource.h>
> #include <vtkCamera.h>
> #include <vtkPolyDataMapper.h>
> #include <vtkPolyDataMapper2D.h>
> #include <vtkDataSetMapper.h>
> #include <vtkCompositePolyDataMapper.h>
> #include <vtkActor.h>
> #include <vtkActor2D.h>
> #include <vtkPlane.h>
> #include <vtkCutter.h>
> #include <vtkPlaneCutter.h>
> #include <vtkProperty.h>
> #include <vtkProperty2D.h>
> #include <vtkRenderWindow.h>
> #include <vtkRenderer.h>
> #include <vtkRenderWindowInteractor.h>
> #include <vtkMath.h>
> #include <vtkInteractorStyle.h>
> #include <vtkInteractorStyleImage.h>
> #include <vtkTransform.h>
> #include <vtkContourTriangulator.h>
> #include <vtkCleanPolyData.h>
> #include <vtkConeSource.h>
> #include <vtkCommand.h>
> #include <vtkSliderWidget.h>
> #include <vtkSliderRepresentation2D.h>
>
> // Callbacks for the interactions
> class SliderCallbackN1 : public vtkCommand {
> public:
> static SliderCallbackN1 *New() {
> return new SliderCallbackN1;
> }
> virtual void Execute(vtkObject *caller, unsigned long, void*) {
> vtkSliderWidget *sliderWidget =
> reinterpret_cast<vtkSliderWidget*>(caller);
> double value = static_cast<vtkSliderRepresentation2D *>(sliderWidget->
> GetRepresentation())->GetValue();
> this->SuperToroid->SetN1(value);
> }
> SliderCallbackN1() :SuperToroid(0) {}
> vtkParametricSuperToroid *SuperToroid;
> };
>
> class SliderCallbackN2 : public vtkCommand {
> public:
> static SliderCallbackN2 *New() {
> return new SliderCallbackN2;
> }
> virtual void Execute(vtkObject *caller, unsigned long, void*) {
> vtkSliderWidget *sliderWidget =
> reinterpret_cast<vtkSliderWidget*>(caller);
> double value = static_cast<vtkSliderRepresentation2D *>(sliderWidget->
> GetRepresentation())->GetValue();
> this->SuperToroid->SetN2(value);
> }
> SliderCallbackN2() :SuperToroid(0) {}
> vtkParametricSuperToroid *SuperToroid;
> };
>
> /**This callback will rotate the surface model about x and y axis
> depending on the
> *current location of the mouse. This will in turn update the cut plane
> that is ment to
> *be normal to the camera and cuts through the middle of the model, showing
> a red
> *cut contour, and green filled contour. */
> class InteractionCallback : public vtkCommand {
> public:
> static InteractionCallback* New() {
> return new InteractionCallback;
> }
>
> virtual void Execute(vtkObject*, unsigned long eventID, void* pCallData)
> VTK_OVERRIDE {
> if (eventID == vtkCommand::MouseMoveEvent) {
> // Get the current mouse position.
> int aiCurrentPosition[2];
> m_pInteractor->GetEventPosition(aiCurrentPosition);
>
> // Get the view port size.
> int iViewPortWidth = m_pInteractor->GetRenderWindow()->GetSize()[0];
> int iViewPortHeight = m_pInteractor->GetRenderWindow()->GetSize()[1];
>
> // Compute rotations about x and y axis.
> int iMousePositionAboutCenterX = aiCurrentPosition[0] - iViewPortWidth/2.0;
> int iMousePositionAboutCenterY = aiCurrentPosition[1] -
> iViewPortHeight/2.0;
> double dRotationAboutX = -iMousePositionAboutCenterY/(
> iViewPortHeight/2.0)*180.0;
> double dRotationAboutY = iMousePositionAboutCenterX/(
> iViewPortWidth/2.0)*180.0;
>
> // Compute transform.
> vtkSmartPointer<vtkTransform> sptmSurfacModel =
> vtkSmartPointer<vtkTransform>::New();
> sptmSurfacModel->RotateX(dRotationAboutX);
> sptmSurfacModel->RotateY(dRotationAboutY);
>
> // Apply the rotation to the surface model actor.
> m_pActorSurface->SetUserMatrix(sptmSurfacModel->GetMatrix());
>
> // Apply the change to the cut plan normal vector.
> // Translations are not required to be removed from the matrix since there
> should be none.
> double adInitialVector[3];
> adInitialVector[0] = 0.0;
> adInitialVector[1] = 0.0;
> adInitialVector[2] = 1.0;
> double adTransformedVector[3];
> sptmSurfacModel->TransformPoint(adInitialVector, adTransformedVector);
> m_pCutPlane->SetNormal(adTransformedVector[0], adTransformedVector[1],
> adTransformedVector[2]);
>
> // Apply the rotation to the contour actor in the opposite direction to
> make normal to camera.
> sptmSurfacModel->Inverse();
> m_pActorContour->SetUserMatrix(sptmSurfacModel->GetMatrix());
>
> // Apply the rotation to the filled actor in the opposite direction to
> make normal to camera.
> m_pActorFilled->SetUserMatrix(sptmSurfacModel->GetMatrix());
>
> m_pInteractor->Render();
> }
> }
>
> // Member variables
> // ----------------
> vtkRenderWindowInteractor* m_pInteractor;
> vtkActor* m_pActorSurface;
> vtkPlane* m_pCutPlane;
> vtkActor* m_pActorContour;
> vtkActor* m_pActorFilled;
> };
>
>
> int main(int, char *[]) {
>
> vtkSmartPointer<vtkParametricSuperToroid> surface =vtkSmartPointer<
> vtkParametricSuperToroid>::New();
> vtkSmartPointer<vtkParametricFunctionSource> source = vtkSmartPointer<
> vtkParametricFunctionSource>::New();
> source->SetParametricFunction(surface);
>
> // Create a synthetic cone.
> /*// Un-commented out so can switch surface model source.
> vtkSmartPointer<vtkConeSource> source = vtkSmartPointer<vtkConeSource>
> ::New();
> source->SetCenter(0, 0, 0);
> source->SetRadius(1);
> source->SetHeight(2);
> source->SetResolution(30);
> source->Update();
> */
>
> vtkSmartPointer<vtkRenderer> renderer =vtkSmartPointer<vtkRenderer>:
> :New();
> vtkSmartPointer<vtkPolyDataMapper> mapper =vtkSmartPointer<
> vtkPolyDataMapper>::New();
> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
>
> mapper->SetInputConnection(source->GetOutputPort());
>
> vtkSmartPointer<vtkProperty> backProperty = vtkSmartPointer<vtkProperty>::
> New();
> backProperty->SetColor(0.8, 0.8, 0.8);
> backProperty->SetOpacity(0.6);
> actor->SetMapper(mapper);
> actor->SetBackfaceProperty(backProperty);
> actor->GetProperty()->SetDiffuseColor(1, 1, 1);
> actor->GetProperty()->SetOpacity(0.6);
>
> vtkSmartPointer<vtkRenderWindow> renderWindow =vtkSmartPointer<
> vtkRenderWindow>::New();
> renderWindow->AddRenderer(renderer);
> renderWindow->SetSize(640, 480);
> renderer->AddActor(actor);
> renderer->SetBackground(.2, .3, .4);
>
> vtkSmartPointer<vtkRenderWindowInteractor> interactor =vtkSmartPointer<
> vtkRenderWindowInteractor>::New();
> interactor->SetRenderWindow(renderWindow);
>
> // Setup a slider widget for each varying parameter BEGIN
> double tubeWidth(.004);
> double sliderLength(.004);
> double titleHeight(.02);
> double labelHeight(.02);
>
> vtkSmartPointer<vtkSliderRepresentation2D> sliderRepN1 = vtkSmartPointer<
> vtkSliderRepresentation2D>::New();
>
> sliderRepN1->SetMinimumValue(0.0);
> sliderRepN1->SetMaximumValue(4.0);
> sliderRepN1->SetValue(1.0);
> sliderRepN1->SetTitleText("Z squareness");
>
> sliderRepN1->GetPoint1Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepN1->GetPoint1Coordinate()->SetValue(.1, .1);
> sliderRepN1->GetPoint2Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepN1->GetPoint2Coordinate()->SetValue(.9, .1);
>
> sliderRepN1->SetTubeWidth(tubeWidth);
> sliderRepN1->SetSliderLength(sliderLength);
> sliderRepN1->SetTitleHeight(titleHeight);
> sliderRepN1->SetLabelHeight(labelHeight);
>
> vtkSmartPointer<vtkSliderWidget> sliderWidgetN1 = vtkSmartPointer<
> vtkSliderWidget>::New();
> sliderWidgetN1->SetInteractor(interactor);
> sliderWidgetN1->SetRepresentation(sliderRepN1);
> sliderWidgetN1->SetAnimationModeToAnimate();
> sliderWidgetN1->EnabledOn();
>
> vtkSmartPointer<SliderCallbackN1> callbackN1 = vtkSmartPointer<
> SliderCallbackN1>::New();
> callbackN1->SuperToroid = surface;
>
> sliderWidgetN1->AddObserver(vtkCommand::InteractionEvent, callbackN1);
>
> vtkSmartPointer<vtkSliderRepresentation2D> sliderRepN2 = vtkSmartPointer<
> vtkSliderRepresentation2D>::New();
>
> sliderRepN2->SetMinimumValue(0.0001);
> sliderRepN2->SetMaximumValue(4.0);
> sliderRepN2->SetValue(1.0);
> sliderRepN2->SetTitleText("XY squareness");
>
> sliderRepN2->GetPoint1Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepN2->GetPoint1Coordinate()->SetValue(.1, .9);
> sliderRepN2->GetPoint2Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepN2->GetPoint2Coordinate()->SetValue(.9, .9);
>
> sliderRepN2->SetTubeWidth(tubeWidth);
> sliderRepN2->SetSliderLength(sliderLength);
> sliderRepN2->SetTitleHeight(titleHeight);
> sliderRepN2->SetLabelHeight(labelHeight);
>
> vtkSmartPointer<vtkSliderWidget> sliderWidgetN2 = vtkSmartPointer<
> vtkSliderWidget>::New();
> sliderWidgetN2->SetInteractor(interactor);
> sliderWidgetN2->SetRepresentation(sliderRepN2);
> sliderWidgetN2->SetAnimationModeToAnimate();
> sliderWidgetN2->EnabledOn();
>
> vtkSmartPointer<SliderCallbackN2> callbackN2 = vtkSmartPointer<
> SliderCallbackN2>::New();
> callbackN2->SuperToroid = surface;
>
> sliderWidgetN2->AddObserver(vtkCommand::InteractionEvent, callbackN2);
>
> vtkSmartPointer<vtkSliderRepresentation2D> sliderRepMinimumV =
> vtkSmartPointer<vtkSliderRepresentation2D>::New();
>
> sliderRepN1->SetMinimumValue(.0001);
> sliderRepMinimumV->SetMaximumValue(.9999*vtkMath::Pi());
> sliderRepMinimumV->SetValue(.0001);
> sliderRepMinimumV->SetTitleText("V min");
>
> sliderRepMinimumV->GetPoint1Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepMinimumV->GetPoint1Coordinate()->SetValue(.1, .1);
> sliderRepMinimumV->GetPoint2Coordinate()->SetCoordinateSystemToNormalize
> dDisplay();
> sliderRepMinimumV->GetPoint2Coordinate()->SetValue(.1, .9);
>
> sliderRepMinimumV->SetTubeWidth(tubeWidth);
> sliderRepMinimumV->SetSliderLength(sliderLength);
> sliderRepMinimumV->SetTitleHeight(titleHeight);
> sliderRepMinimumV->SetLabelHeight(labelHeight);
>
> surface->SetN1(1.0);
> surface->SetN2(1.0);
> // Setup a slider widget for each varying parameter END
>
> // Set up the cut plane.
> vtkSmartPointer<vtkPlane> planeCut = vtkSmartPointer<vtkPlane>::New();
> planeCut->SetOrigin(0.0, 0.0, 0.0);
> planeCut->SetNormal(0.0, 0.0, 1.0);
>
> // Set up the cutter which will produce the contour polygons.
> vtkSmartPointer<vtkCutter> polygonsContour = vtkSmartPointer<vtkCutter>::
> New();
> //vtkSmartPointer<vtkPlaneCutter> polygonsContour = vtkSmartPointer<vtkPlaneCutter>::New();
> // testjal
> polygonsContour->SetInputConnection(source->GetOutputPort());
> //polygonsContour->SetPlane(planeCut); // SetPlane only works with a
> vtkPlaneCutter. // testjal
> polygonsContour->SetCutFunction(planeCut);
>
> // Clean the polygons from the cutter. Note, this is an experiment to see
> if this helps the fills. It does not
> // seem to help.
> vtkSmartPointer<vtkCleanPolyData> polygonsContourClean = vtkSmartPointer<vtkCleanPolyData>::New();
> // testjal
> polygonsContourClean->SetInputConnection(polygonsContour->GetOutputPort());
> // testjal
>
> // Set up the filled polygons of the contour.
> vtkSmartPointer<vtkContourTriangulator> polygonsFilled = vtkSmartPointer<
> vtkContourTriangulator>::New();
> polygonsFilled->SetInputConnection(polygonsContourClean->GetOutputPort());
> polygonsFilled->TriangulationErrorDisplayOn(); // testjal
>
> // Set up the mapper of the contour.
> vtkSmartPointer<vtkDataSetMapper> mapperContour = vtkSmartPointer<
> vtkDataSetMapper>::New();
> mapperContour->SetInputConnection(polygonsContourClean->GetOutputPort());
> mapperContour->ScalarVisibilityOff();
>
> // Set up the mapper of the filled polygons of the contour
> vtkSmartPointer<vtkDataSetMapper> mapperFilled = vtkSmartPointer<
> vtkDataSetMapper>::New();
> mapperFilled->SetInputConnection(polygonsFilled->GetOutputPort());
> mapperFilled->ScalarVisibilityOff();
>
> // Set up the actor of the contour.
> vtkSmartPointer<vtkActor> actorContour = vtkSmartPointer<vtkActor>::New();
> actorContour->SetMapper(mapperContour);
> actorContour->GetProperty()->SetColor(1,0,0);
> actorContour->GetProperty()->SetLineWidth(5);
>
> // Set up the actor of the filled polygons of the contour.
> vtkSmartPointer<vtkActor> actorFilled = vtkSmartPointer<vtkActor>::New();
> actorFilled->SetMapper(mapperFilled);
> actorFilled->GetProperty()->SetColor(0, 1, 0);
>
> // Add the contour actor.
> renderer->AddActor(actorContour);
>
> // Add the filld polygons of the contour.
> renderer->AddActor(actorFilled);
>
> // Set up the interaction.
> vtkSmartPointer<InteractionCallback> callback = vtkSmartPointer<
> InteractionCallback>::New();
> callback->m_pInteractor = interactor.Get();
> callback->m_pActorSurface = actor.Get();
> callback->m_pCutPlane = planeCut.Get();
> callback->m_pActorContour = actorContour.Get();
> callback->m_pActorFilled = actorFilled.Get();
> vtkSmartPointer<vtkInteractorStyle> style = vtkSmartPointer<
> vtkInteractorStyle>::New();
> interactor->SetInteractorStyle(style);
> style->AddObserver(vtkCommand::MouseMoveEvent, callback);
>
> renderer->ResetCamera(-1, 1, -1, 1, -1, 1);
> renderer->GetActiveCamera()->ParallelProjectionOn();
> renderWindow->Render();
>
> interactor->Initialize();
>
> interactor->Start();
>
> return EXIT_SUCCESS;
> }
>
> -----Original Message-----
> From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of
> vtkusers-request at vtk.org
> Sent: Friday, March 02, 2018 3:19 PM
> To: vtkusers at vtk.org
> Subject: vtkusers Digest, Vol 167, Issue 6
>
> Send vtkusers mailing list submissions to
> vtkusers at vtk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.
> org_mailman_listinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-
> OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=
> LEPlWwob3RaATj2F7NLtpCgz9jCbYxrZVKqUBxw04QA&s=
> Ej7w16ZJQy02Uvg3d2LzSZ7xIDDkBIUqNYKBToY2xxE&e=
> 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. Problem with vtkContourTriangulator and vtkPlaneCutter
> (Jeffery Lewis)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 2 Mar 2018 22:57:44 +0000
> From: Jeffery Lewis <jlewis at accuray.com>
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Subject: [vtkusers] Problem with vtkContourTriangulator and
> vtkPlaneCutter
> Message-ID:
> <DM5PR0501MB3749070F9E8CBAEFFE5D3241C5C50 at DM5PR0501MB3749.
> namprd05.prod.outlook.com>
>
> Content-Type: text/plain; charset="us-ascii"
>
> I have a prototype that generates a super toroid surface model. A cut
> plane is defined to be orthogonal to the camera line of sight, and cuts
> through the middle of the surface model. The cut contour (generated by
> vtkCutter), and filled cut contour (generated by vtkContourTriangulator) is
> rendered with the surface model. The surface model is shown transparent as
> it is only a reference. The rendering of interest is the cut contour (shown
> as red contour) and filled cut contour (shown as green). Moving the mouse
> rotates the surface model. The cut plane stays orthogonal to the camera
> while the surface model rotates. By rotating the surface model, you can see
> the cut contour and filled cut contour get updated interactively as it
> slices through the middle of the surface model.
>
> Unfortunately, the filled cut contour does not look right and I can't seem
> to figure it out. If I change the surface model to something simpler like a
> cone, then everything looks fine.
>
> Also of note is that if I switch out the vtkCutter with a vtkPlaneCutter,
> the program crashes. I would like to use the vtkPlaneCutter since from its
> documentation seems to indicate that it will get better performance. The
> vtkPlaneCutter crashes using either the super toroid or cone.
>
> Attached is the source code. The stuff between "// Setup a slider widget
> for each varying parameter BEGIN" and "// Setup a slider widget for each
> varying parameter END" can be ignored as this only involves setting up
> sliders to manipulate the super toroid, which comes from the
> ParametricSuperToroidDemo example. The setup of the pipleline for the cut
> contour and filled cut contour is near the bottom.
>
> Also attached is a sample screen shot of the incorrect filled cut contour.
>
>
>
>
> Jeffery Lewis
> Staff Software Engineer, Treatment Planning Systems
>
> 1310 Chesapeake Terrace
> Sunnyvale, CA 94089
> USA
> Tel: 1.408.789.4367
> jlewis at accuray.com
>
>
>
--
___________________________________________
Andrew J. P. Maclean
___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180306_4d1746b5_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=kPxYBDyMVsu-AjUanM387H90qN8ZuITeD3-pqRCsbLs&e=>
------------------------------
Message: 12
Date: Tue, 6 Mar 2018 07:00:39 +0000 (UTC)
From: Koteswara Rao Ruvva <ruvva at yahoo.com>
To: Todd via Vtkusers <vtkusers at vtk.org>
Subject: [vtkusers] Assembly Rotation
Message-ID: <1188740731.10630293.1520319639402 at mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"
Hello All,
I have a vtkAssembly that is made out of two vtkPolydata objects. After rendering them, I create points and lines interactively and add to the assembly using AddPart method. So far so good.
When I rotate the assembly about a vector by an angle 'theta', the Polydata objects rotate by correct amount. But?the points and the lines rotate by double the theta. And no issues with translation.
I could not figure it out. Any help?
Thank youRao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180306_2c12fee6_attachment-2D0001.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=a5bocb_hfGAVz6vd5WGH4CcZGeLYbtisVx47YZ8wcfs&e=>
------------------------------
Message: 13
Date: Tue, 6 Mar 2018 11:20:08 +0100
From: Ignacio Fern?ndez Galv?n <jellby at yahoo.com>
To: vtkusers at vtk.org
Subject: [vtkusers] VTK + Qt in a remote ssh session
Message-ID: <7fabd892-3511-fb0e-baa2-7f0e2d68caac at yahoo.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi,
I'm trying to run an application using python, VTK and Qt in a remote
box through an ssh connection. A simple example with just python+VTK
works by using vglrun, but when I try python+VTK+Qt I get:
ERROR: In
/work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx,
line 785
vtkXOpenGLRenderWindow (0x1e5bde0): GLEW could not be initialized.
If instead of a plain ssh connection I use the ThinLinc client, then
with vglrun both work. How could I solve/debug this?
I'm using VTK 8.1.0 installed with pip, and I've tried differet PyQt4,
PyQt5, PySide versions all to the same effect.
Thanks,
Ignacio
These are my sample files:
test.py
===============================================
import vtk
cylinder = vtk.vtkCylinderSource()
cylinder.SetResolution(8)
cylinderMapper = vtk.vtkPolyDataMapper()
cylinderMapper.SetInputConnection(cylinder.GetOutputPort())
cylinderActor = vtk.vtkActor()
cylinderActor.SetMapper(cylinderMapper)
cylinderActor.GetProperty().SetColor(1,0,0)
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren.AddActor(cylinderActor)
iren.Initialize()
iren.Start()
===============================================
testqt.py
===============================================
import sys
import vtk
from qtpy import QtCore, QtGui, QtWidgets
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent = None):
QtWidgets.QMainWindow.__init__(self, parent)
self.frame = QtWidgets.QFrame()
self.vl = QtWidgets.QVBoxLayout()
self.vtkWidget = QVTKRenderWindowInteractor(self.frame)
self.vl.addWidget(self.vtkWidget)
self.ren = vtk.vtkRenderer()
self.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
self.iren = self.vtkWidget.GetRenderWindow().GetInteractor()
# Create source
source = vtk.vtkSphereSource()
source.SetCenter(0, 0, 0)
source.SetRadius(5.0)
# Create a mapper
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(source.GetOutputPort())
# Create an actor
actor = vtk.vtkActor()
actor.SetMapper(mapper)
self.ren.AddActor(actor)
self.ren.ResetCamera()
self.frame.setLayout(self.vl)
self.setCentralWidget(self.frame)
self.show()
self.iren.Initialize()
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
sys.exit(app.exec_())
===============================================
------------------------------
Message: 14
Date: Tue, 6 Mar 2018 13:29:02 +0100
From: Amine Aboufirass <amine.aboufirass at gmail.com>
To: paraview at public.kitware.com, VTK Users <vtkusers at vtk.org>, VTK
Developers <vtk-developers at vtk.org>, ParaView Developers
<paraview-developers at paraview.org>
Subject: [vtkusers] Rendering and saving unstructured grid mesh to
image file
Message-ID:
<CAMwawgOtB=omDARnyP-=RhVHauKzFAHPSQQfyQGgevJ471akxg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Dear all,
I have an unstructured grid cell data file which I would like to render and
then save to a png image. I made use of available examples to generate a
python code which I have attached below. The file I am using this with is
also attached. The rendering seems to work but I am not sure why it cannot
send the render window content to an image. It keeps giving me the
following error:
?!: libpng warning: Image width is zero in IHDR
?!: libpng warning: Image height is zero in IHDR
I'm not sure what is causing this, I followed the documentation to the best
of my ability but still can't figure it out. Could anyone please help?
Thanks
Amine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180306_42637413_attachment.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=e1jRW28lIWwZJ3pDG5xFcdOXVZhyqlWCR2TQ1ypENGQ&e=>
-------------- next part --------------
from vtk import *
# The source file
file_name = 'MeshData.vtk'#"MeshData.vtk"
# Read the source file.
reader = vtkUnstructuredGridReader()
reader.SetFileName(file_name)
reader.Update() # Needed because of GetScalarRange
output = reader.GetOutput()
#scalar_range = output.GetScalarRange()
# Create the mapper that corresponds the objects of the vtk file
# into graphics elements
mapper = vtkDataSetMapper()
mapper.SetInputData(output)
#mapper.SetScalarRange(scalar_range)
# Create the Actor
actor = vtkActor()
actor.GetProperty().SetRepresentationToWireframe()
actor.SetMapper(mapper)
# Create the Renderer
renderer = vtkRenderer()
renderer.AddActor(actor)
renderer.SetBackground(1, 1, 1) # Set background to white
# Create the RendererWindow
renderer_window = vtkRenderWindow()
renderer_window.AddRenderer(renderer)
#Image https://urldefense.proofpoint.com/v2/url?u=https-3A__www.vtk.org_Wiki_VTK_Examples_Python_Screenshot&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=pRLXlyyqx1ouO7MYLTjJGwBgXK6CsaJY-16ikvhTLTs&e=
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(renderer_window)
w2if.Update()
writer = vtk.vtkPNGWriter()
writer.SetFileName("screenshot.png")
writer.SetInputData(w2if.GetOutput())
writer.Write()
# Create the RendererWindowInteractor and display the vtk_file
#interactor = vtkRenderWindowInteractor()
#interactor.SetRenderWindow(renderer_window)
#interactor.Initialize()
#interactor.Start()
#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MeshData.vtk
Type: application/octet-stream
Size: 566142 bytes
Desc: not available
URL: <https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_pipermail_vtkusers_attachments_20180306_42637413_attachment.obj&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=-5M3_YRVBpZvXHFOhrWt7zmg6LQ_in-89ujuAWJvd5M&e=>
------------------------------
Subject: Digest Footer
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=68iGeE9EI54qfZjkbpoDtnQcVUn_zOQBlUMEtsdtER0&e=
Please keep messages on-topic and check the VTK FAQ at: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=4vWmhE6snubmnh4n3w18s3fAMY84jczAIn076hKXtxo&e=
Search the list archives at: https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=A_26bezXudAI1o583GywYuDetkaSQqFX-AERDqviacI&e=
Follow this link to subscribe/unsubscribe:
https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_listinfo_vtkusers&d=DwICAg&c=xPsIBl5KrHsS6I-OqwKVfQ&r=D9BdhfXHHQX-uhgMiAohLoGTItPHXF-7rtsYkItEKmE&m=LzDma4aBFHGZKAtPn_bt9-VNjhbyVLR57wCEQUEqyHQ&s=MWPDDDsPKpMgwMJj4wU5oge7N5g3Nur9iaPwBS295Gs&e=
------------------------------
End of vtkusers Digest, Vol 167, Issue 12
*****************************************
-- WARNING - CONFIDENTIAL INFORMATION: The information contained in the e-mail may contain confidential and privileged information and is intended solely for the use of the intended recipient(s). Access for any review, re-transmission, dissemination or other use of, or taking of any action in regard and reliance upon this e-mail by persons or entities other than the intended recipient(s) is unauthorized and prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.
More information about the vtkusers
mailing list