Normals at intersection point

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Normals at intersection point

João Luis
Hi

arwtyxouymz <[hidden email]>

vtkBestFitPlane could help you, or just using the following code (input array of points or one point)

void computeBestFitNormal(std::vector<vtkVector3d> v, int n/* vector size*/, vtkVector3d& vNormal)
{
double resultX;
double resultY;
double resultZ;
const double *p = v[n - 1].GetData();
const double *c;

// Iterate through the vertices
for (int i = 0; i < n; i++){
// Get shortcut to the "current" vertex
c = v[i].GetData();

// Add in edge vector products appropriately
resultX += (p[2] + c[2])*(p[1] - c[1]);
resultY += (p[0] + c[0])*(p[2] - c[2]);
resultZ += (p[1] + c[1])*(p[0] - c[0]);

// Next vertex
p = c;
}
vNormal.Set(resultX,resultY,resultZ);
vNormal.Normalize();
p = nullptr;
c = nullptr;

}

On Tue, Aug 1, 2017 at 12:00 PM, <[hidden email]> wrote:
Send vtkusers mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://public.kitware.com/mailman/listinfo/vtkusers
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

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


Today's Topics:

   1. Re: vtkTextureObject bind error (Rick Dailey)
   2. Re: vtkTextureObject bind error (Alvaro Sanchez)
   3. Re: vtkTextureObject bind error (Rick Dailey)
   4. Re: VTK Development Survey (Robert Maynard)
   5. Re: vtkTextureObject bind error (Alvaro Sanchez)
   6. Re: image rendering speed (mikewithascarf)
   7. Is it possible to make the VTKTextbook.pdf better? (chensq)
   8. How to split large models into smaller pieces when exporting
      the scene? (landings)
   9. How to change window level & window width of
      vtkInteractorStyleImage (K O ranjith)
  10. Re: vtkTextureObject bind error (Rick Dailey)
  11. Re: How to split large models into smaller pieces when
      exporting the scene? (Bill Lorensen)
  12. Re: vtkTextureObject bind error (Alvaro Sanchez)
  13. Re: vtkTextureObject bind error (Bill Lorensen)
  14. Normals at intersection point (arwtyxouymz)


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

Message: 1
Date: Mon, 31 Jul 2017 09:35:20 -0700 (MST)
From: Rick Dailey <[hidden email]>
To: [hidden email]
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=us-ascii

I tried running ctest but no matter what I do it always says "No tests were
found!!!"  I tried running it from several folders (bin, testing, etc.) but
still the same message.  It seems that I have built VTK with testing enabled
(BUILD_TESTING check set) so a I am out of ideas.  What is the correct way
of running ctest?

The latest stack trace:

>       ucrtbased.dll!common_assert_to_message_box<wchar_t>(const wchar_t * const
expression, const wchar_t * const file_name, const unsigned int line_number,
void * const return_address) Line 351   C++
        ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression,
const wchar_t * const file_name, const unsigned int line_number, void *
const return_address) Line 386  C++
        ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t *
file_name, unsigned int line_number) Line 404   C++
        vtkRenderingOpenGL2-8.1.dll!vtkTextureObject::Bind() Line 546   C++
        vtkRenderingOpenGL2-8.1.dll!vtkTextureObject::Activate() Line 491       C++
        vtkRenderingVolumeOpenGL2-8.1.dll!vtkVolumeMask::Activate() Line 64     C++

vtkRenderingVolumeOpenGL2-8.1.dll!vtkOpenGLGPUVolumeRayCastMapper::DoGPURender(vtkRenderer
* ren, vtkVolume * vol, vtkOpenGLCamera * cam, vtkShaderProgram * prog, int
noOfComponents, int independentComponents) Line 3739    C++

vtkRenderingVolumeOpenGL2-8.1.dll!vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer
* ren, vtkVolume * vol) Line 3610       C++
        vtkRenderingVolume-8.1.dll!vtkGPUVolumeRayCastMapper::Render(vtkRenderer *
ren, vtkVolume * vol) Line 154  C++
        vtkRenderingCore-8.1.dll!vtkVolume::RenderVolumetricGeometry(vtkViewport *
vp) Line 370    C++
        vtkRenderingOpenGL2-8.1.dll!vtkOpenGLRenderer::UpdateGeometry() Line 273
C++
        vtkRenderingOpenGL2-8.1.dll!vtkOpenGLRenderer::DeviceRender() Line 170  C++
        vtkRenderingCore-8.1.dll!vtkRenderer::Render() Line 351 C++
        vtkRenderingCore-8.1.dll!vtkRendererCollection::Render() Line 51        C++
        vtkRenderingCore-8.1.dll!vtkRenderWindow::DoStereoRender() Line 781     C++
        vtkRenderingCore-8.1.dll!vtkRenderWindow::DoFDRender() Line 747 C++
        vtkRenderingCore-8.1.dll!vtkRenderWindow::DoAARender() Line 626 C++
        vtkRenderingCore-8.1.dll!vtkRenderWindow::Render() Line 439     C++
        PDI-TOMO.exe!vtkControlBase::Render(HDC * dc, const wchar_t * location)
Line 694        C++




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureObject-bind-error-tp5744068p5744223.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Message: 2
Date: Mon, 31 Jul 2017 10:32:33 -0700
From: Alvaro Sanchez <[hidden email]>
To: Rick Dailey <[hidden email]>
Cc: VTK Users <[hidden email]>
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID:
        <CADM17uP_HkG8G2+etGt8NsF+Q0zhe8stNerGVU4i-9XTANYB=[hidden email]>
Content-Type: text/plain; charset="utf-8"

If you built vtk with BUILD_TESTING checked then you should be able to
run it from the build directory as

C:\YOUR_VS_SOLUTION_DIR>ctest -R TextureStreaming -C Debug

Change the last parameter to your particular configuration.

Are you setting a volume mask or are you only rendering input data?

On Mon, Jul 31, 2017 at 9:35 AM, Rick Dailey <[hidden email]> wrote:

> I tried running ctest but no matter what I do it always says "No tests were
> found!!!"  I tried running it from several folders (bin, testing, etc.) but
> still the same message.  It seems that I have built VTK with testing
> enabled
> (BUILD_TESTING check set) so a I am out of ideas.  What is the correct way
> of running ctest?
>
> The latest stack trace:
>
> >       ucrtbased.dll!common_assert_to_message_box<wchar_t>(const wchar_t
> * const
> expression, const wchar_t * const file_name, const unsigned int
> line_number,
> void * const return_address) Line 351   C++
>         ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const
> expression,
> const wchar_t * const file_name, const unsigned int line_number, void *
> const return_address) Line 386  C++
>         ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t *
> file_name, unsigned int line_number) Line 404   C++
>         vtkRenderingOpenGL2-8.1.dll!vtkTextureObject::Bind() Line 546
>  C++
>         vtkRenderingOpenGL2-8.1.dll!vtkTextureObject::Activate() Line
> 491       C++
>         vtkRenderingVolumeOpenGL2-8.1.dll!vtkVolumeMask::Activate() Line
> 64     C++
>
> vtkRenderingVolumeOpenGL2-8.1.dll!vtkOpenGLGPUVolumeRayCastMappe
> r::DoGPURender(vtkRenderer
> * ren, vtkVolume * vol, vtkOpenGLCamera * cam, vtkShaderProgram * prog, int
> noOfComponents, int independentComponents) Line 3739    C++
>
> vtkRenderingVolumeOpenGL2-8.1.dll!vtkOpenGLGPUVolumeRayCastMappe
> r::GPURender(vtkRenderer
> * ren, vtkVolume * vol) Line 3610       C++
>         vtkRenderingVolume-8.1.dll!vtkGPUVolumeRayCastMapper::Render(vtkRenderer
> *
> ren, vtkVolume * vol) Line 154  C++
>         vtkRenderingCore-8.1.dll!vtkVolume::RenderVolumetricGeometry(vtkViewport
> *
> vp) Line 370    C++
>         vtkRenderingOpenGL2-8.1.dll!vtkOpenGLRenderer::UpdateGeometry()
> Line 273
> C++
>         vtkRenderingOpenGL2-8.1.dll!vtkOpenGLRenderer::DeviceRender()
> Line 170  C++
>         vtkRenderingCore-8.1.dll!vtkRenderer::Render() Line 351 C++
>         vtkRenderingCore-8.1.dll!vtkRendererCollection::Render() Line 51
>       C++
>         vtkRenderingCore-8.1.dll!vtkRenderWindow::DoStereoRender() Line
> 781     C++
>         vtkRenderingCore-8.1.dll!vtkRenderWindow::DoFDRender() Line 747
> C++
>         vtkRenderingCore-8.1.dll!vtkRenderWindow::DoAARender() Line 626
> C++
>         vtkRenderingCore-8.1.dll!vtkRenderWindow::Render() Line 439
>  C++
>         PDI-TOMO.exe!vtkControlBase::Render(HDC * dc, const wchar_t *
> location)
> Line 694        C++
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/vtkTextureObject-bind-error-tp5744068p5744223.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: <a href="tel:518-881-4901" value="+555188814901">518-881-4901
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170731/cc2ae9a2/attachment-0001.html>

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

Message: 3
Date: Mon, 31 Jul 2017 10:41:55 -0700 (MST)
From: Rick Dailey <[hidden email]>
To: [hidden email]
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=us-ascii

With the additional information you supplied I was able to successfully run
ctest.

100% tests passed, 0 tests failed out of 1

Yes, I am using a volume mask.



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureObject-bind-error-tp5744068p5744226.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Message: 4
Date: Mon, 31 Jul 2017 14:25:26 -0400
From: Robert Maynard <[hidden email]>
To: vtk vtk <[hidden email]>
Subject: Re: [vtkusers] VTK Development Survey
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="UTF-8"

I would like to remind everyone that the survey closes tomorrow.

On Fri, Jul 28, 2017 at 9:21 AM, Robert Maynard
<[hidden email]> wrote:
> Hi Everybody,
>
> I would like to remind everyone that the developer survey is closing
> in 4 days so please respond.
>
> On Tue, Jul 18, 2017 at 11:32 AM, Robert Maynard
> <[hidden email]> wrote:
>> Hi Everybody,
>>
>> The VTK team is always looking to attract new developers and improve
>> the experience of developing VTK.
>>
>> To further that, we are putting out an anonymous survey to collect
>> data on people's thoughts about the current software development
>> process for VTK.  We would love to hear all your rants ( or raves ) on
>> the development process. We will gather the results after August 1'st.
>>
>> https://goo.gl/forms/WlqyiF0sBTZT7klJ3
>>
>> Thank you for your inputs.


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

Message: 5
Date: Mon, 31 Jul 2017 14:29:48 -0400
From: Alvaro Sanchez <[hidden email]>
To: Rick Dailey <[hidden email]>
Cc: VTK Users <[hidden email]>
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID:
        <CADM17uMxnb5vGjzadovjhY3XPm2CeD+jQpLCB=[hidden email]>
Content-Type: text/plain; charset="utf-8"

Using masks with streaming enabled might be the issue. Currently, only the
input supports
texture streaming.  Could you try rendering without any masks?

On Mon, Jul 31, 2017 at 1:41 PM, Rick Dailey <[hidden email]> wrote:

> With the additional information you supplied I was able to successfully run
> ctest.
>
> 100% tests passed, 0 tests failed out of 1
>
> Yes, I am using a volume mask.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/vtkTextureObject-bind-error-tp5744068p5744226.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: <a href="tel:518-881-4901" value="+555188814901">518-881-4901
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170731/a20286db/attachment-0001.html>

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

Message: 6
Date: Mon, 31 Jul 2017 14:43:45 -0700 (MST)
From: mikewithascarf <[hidden email]>
To: [hidden email]
Subject: Re: [vtkusers] image rendering speed
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=us-ascii

Thanks Ken. Unfortunately vtkRenderTimerLog doesn't appear to be in VTK as
far as I can tell? I'm using VTK 7.1.0.



--
View this message in context: http://vtk.1045678.n5.nabble.com/image-rendering-speed-tp5744115p5744230.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Message: 7
Date: Tue, 1 Aug 2017 10:18:08 +0800
From: "chensq" <[hidden email]>
To: "vtkusers" <[hidden email]>
Subject: [vtkusers] Is it possible to make the VTKTextbook.pdf better?
Message-ID: <8963ED62896641DEA819B1963E997040@chensqPC>
Content-Type: text/plain; charset="gb2312"

All of the formulas are disordered.
Sincerely Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170801/fc1242d7/attachment-0001.html>

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

Message: 8
Date: Mon, 31 Jul 2017 19:49:07 -0700 (MST)
From: landings <[hidden email]>
To: [hidden email]
Subject: [vtkusers] How to split large models into smaller pieces when
        exporting the scene?
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=us-ascii

Hi, I'm using VTK with Unity 3D.
I use vtkX3DExporter to export my VTK scene, and rebuild the meshes in
Unity.
Unity and maybe all game engines don't support single models that have more
than 65536 vertices. I must split large models into smaller pieces.
Is there an existing method to do this, or do I need to implement this
myself? If the latter, could you give me some hints?



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-split-large-models-into-smaller-pieces-when-exporting-the-scene-tp5744232.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Message: 9
Date: Tue, 1 Aug 2017 12:40:57 +0530
From: K O ranjith <[hidden email]>
To: vtkusers <[hidden email]>
Subject: [vtkusers] How to change window level & window width of
        vtkInteractorStyleImage
Message-ID:
        <CANuVs=[hidden email]>
Content-Type: text/plain; charset="utf-8"

Hello all,

I'm using using vtkImageViewer2
to display dicom images and uses custom interactor inherited  from
vtkInteractorStyleImage.

And  uses left mouse button down move event to modify window level and width.

I need to manually set window level
and window width of the viewing image to custom value.

for this I'm using the methods


vtkImageViewer2->*SetColorLevel*(double level);

vtkImageViewer2->*SetColorWindow*(double width);

But, even after setting the values
it is not reflecting in vtkInteractorStyleImage,

The method,

vtkInteractorStyleImage->*GetWindowLevelCurrentPosition*(int
windolevel, int windowwidth);

returning different values than  set in vtkImageViewer2.

Have any method to manually modify
window level and window values of vtkInteractorStyleImage to custom value.

(something like SetColorLevel
SetColorWindow of vtkImageViewer2)

My intention is to manually modify
window values of displaying image.

Please help...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170801/51154bb1/attachment-0001.html>

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

Message: 10
Date: Tue, 1 Aug 2017 03:51:56 -0700 (MST)
From: Rick Dailey <[hidden email]>
To: [hidden email]
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=us-ascii

Rendering without a mask works, but of course this is not a solution for us
as the mask is an integral part of our product.

Is there anything that can be done about this?



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureObject-bind-error-tp5744068p5744234.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Message: 11
Date: Tue, 1 Aug 2017 07:43:03 -0400
From: Bill Lorensen <[hidden email]>
To: landings <[hidden email]>
Cc: VTK Users <[hidden email]>
Subject: Re: [vtkusers] How to split large models into smaller pieces
        when exporting the scene?
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="UTF-8"

This example may help:
https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/SplitPolyData/

Bill

On Mon, Jul 31, 2017 at 10:49 PM, landings <[hidden email]> wrote:
> Hi, I'm using VTK with Unity 3D.
> I use vtkX3DExporter to export my VTK scene, and rebuild the meshes in
> Unity.
> Unity and maybe all game engines don't support single models that have more
> than 65536 vertices. I must split large models into smaller pieces.
> Is there an existing method to do this, or do I need to implement this
> myself? If the latter, could you give me some hints?
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/How-to-split-large-models-into-smaller-pieces-when-exporting-the-scene-tp5744232.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



--
Unpaid intern in BillsBasement at noware dot com


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

Message: 12
Date: Tue, 1 Aug 2017 09:08:28 -0400
From: Alvaro Sanchez <[hidden email]>
To: Rick Dailey <[hidden email]>
Cc: VTK Users <[hidden email]>
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID:
        <CADM17uMc_2GD=D6f32cW5MC58xZCHnE=6WO9CXBMu+8bw=[hidden email]>
Content-Type: text/plain; charset="utf-8"

There is on-going work to support streaming with masks on.  It is too early
to try the branch
however,  I will keep you posted.

The only solution I see for now (as Ken suggested earlier) would be to
resize your input
volume (and masks).  You could use vtkImageResize for this,  have a look at
the following
test as an example
<https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastTextureStreaming.cxx#L61>
.

On Tue, Aug 1, 2017 at 6:51 AM, Rick Dailey <[hidden email]> wrote:

> Rendering without a mask works, but of course this is not a solution for us
> as the mask is an integral part of our product.
>
> Is there anything that can be done about this?
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/vtkTextureObject-bind-error-tp5744068p5744234.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: <a href="tel:518-881-4901" value="+555188814901">518-881-4901
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170801/8e8e2412/attachment-0001.html>

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

Message: 13
Date: Tue, 1 Aug 2017 09:13:49 -0400
From: Bill Lorensen <[hidden email]>
To: Alvaro Sanchez <[hidden email]>
Cc: VTK Users <[hidden email]>, Rick Dailey <[hidden email]>
Subject: Re: [vtkusers] vtkTextureObject bind error
Message-ID:
        <CADZJ4hPuhOPNBgq=8Zh9gQh8vdHp=LCbxX98pDLqDLMz3v3P=[hidden email]>
Content-Type: text/plain; charset="UTF-8"

Here is an example of vtkImageResize
https://lorensen.github.io/VTKExamples/site/Cxx/Images/ResizeImage/

Bill

On Tue, Aug 1, 2017 at 9:08 AM, Alvaro Sanchez
<[hidden email]> wrote:
> There is on-going work to support streaming with masks on.  It is too early
> to try the branch
> however,  I will keep you posted.
>
> The only solution I see for now (as Ken suggested earlier) would be to
> resize your input
> volume (and masks).  You could use vtkImageResize for this,  have a look at
> the following
> test as an example.
>
> On Tue, Aug 1, 2017 at 6:51 AM, Rick Dailey <[hidden email]> wrote:
>>
>> Rendering without a mask works, but of course this is not a solution for
>> us
>> as the mask is an integral part of our product.
>>
>> Is there anything that can be done about this?
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/vtkTextureObject-bind-error-tp5744068p5744234.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
> --
> Alvaro Sanchez
> Kitware, Inc.
> Senior R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: <a href="tel:518-881-4901" value="+555188814901">518-881-4901
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Unpaid intern in BillsBasement at noware dot com


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

Message: 14
Date: Tue, 1 Aug 2017 08:12:26 -0700 (MST)
From: arwtyxouymz <[hidden email]>
To: [hidden email]
Subject: [vtkusers] Normals at intersection point
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=UTF-8

Hi, all

I want to get normals at intersection point between ellipse and line.
I could get the intersection point, but I don't know how to get normals at
that point.
That part of My code is below.

Please help me!

========================================
    double angle = 0;
    double long_r, short_r;
    vtkIdType id = 0;
    double CenterX, CenterY, CenterZ;
    double z_length = 50.0;
    long_r = 50;
    short_r = 30;
    CenterX = 0.0; CenterY = 0.0, CenterZ = 0.0;

    vtkSmartPointer<vtkPoints> points =
            vtkSmartPointer<vtkPoints>::New();
    points->SetNumberOfPoints(2 * NUM_OF_DIVIDE);
    while (angle <= 2.0 * vtkMath::Pi() + (vtkMath::Pi() / NUM_OF_DIVIDE))
    {
        points->InsertPoint(id, long_r * cos(angle) + CenterX, short_r *
sin(angle) + CenterY, CenterZ);
        angle = angle + (vtkMath::Pi() / NUM_OF_DIVIDE);
        id++;
    }

    vtkSmartPointer<vtkPolyLine> line =
            vtkSmartPointer<vtkPolyLine>::New();
    line->GetPointIds()->SetNumberOfIds(id);
    for (int k = 0; k < id; ++k) {
        line->GetPointIds()->SetId(k, k);
    }

    vtkSmartPointer<vtkCellArray> lines =
            vtkSmartPointer<vtkCellArray>::New();
    lines->InsertNextCell(line);

    vtkSmartPointer<vtkPolyData> ellipse =
            vtkSmartPointer<vtkPolyData>::New();
    ellipse->GlobalReleaseDataFlagOff();
    ellipse->Allocate(1, 1);
    ellipse->SetPoints(points);
    ellipse->SetLines(lines);

    // 3???
    vtkSmartPointer<vtkLinearExtrusionFilter> extrude =
            vtkSmartPointer<vtkLinearExtrusionFilter>::New();
    extrude->SetInputData(ellipse);
    extrude->SetExtrusionTypeToNormalExtrusion();
    extrude->SetScaleFactor(1.0);
    extrude->SetVector(0, 0, z_length);
    extrude->Update();

    vtkSmartPointer<vtkTriangleFilter> triangles =
            vtkSmartPointer<vtkTriangleFilter>::New();
    triangles->SetInputConnection(extrude->GetOutputPort());
    triangles->Update();

    auto numberOfSubdivisions = 2;
    vtkSmartPointer<vtkLinearSubdivisionFilter> subdivision =
            vtkSmartPointer<vtkLinearSubdivisionFilter>::New();
    subdivision->SetInputConnection(triangles->GetOutputPort());
    subdivision->SetNumberOfSubdivisions(numberOfSubdivisions);
    subdivision->Update();

    /////////////////// Omit ///////////////////////////

    double lineP0[3] = {TARGET_X, TARGET_Y, TARGET_Z};
    double lineP1[3] = {surfacePoints[minId][0] + directionVector[minId][0],
                        surfacePoints[minId][1] + directionVector[minId][1],
                        surfacePoints[minId][2] +
directionVector[minId][2]};
    vtkSmartPointer<vtkPoints> intersectPoints =
            vtkSmartPointer<vtkPoints>::New();
    vtkSmartPointer<vtkOBBTree> tree =
            vtkSmartPointer<vtkOBBTree>::New();
    tree->SetDataSet(subdivision->GetOutput());
    tree->BuildLocator();
    tree->IntersectWithLine(lineP0, lineP1, intersectPoints, NULL);
    std::cout << "NumPoints: " << intersectPoints->GetNumberOfPoints() <<
std::endl;
    double intersection[3];
    for (int i = 0; i < intersectPoints->GetNumberOfPoints(); i++)
    {
        intersectPoints->GetPoint(i, intersection);
        std::cout << "Intersection " << i << ":"
                  << intersection[0] << ", "
                  << intersection[1] << ", "
                  << intersection[2] << std::endl;
    }
====================================================



--
View this message in context: http://vtk.1045678.n5.nabble.com/Normals-at-intersection-point-tp5744238.html
Sent from the VTK - Users mailing list archive at Nabble.com.


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

Subject: Digest Footer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

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

End of vtkusers Digest, Vol 160, Issue 1
****************************************


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...