Page 1 of 1

Sets of curves

Posted: Wed Oct 18, 2017 7:08 am
by Dino R
Hello,

I am simulating gear contact in mechanism. I am looking into multiple LineStrips into a single section right now.
For each line on the Contact Pattern (there are several), I do create a LineStrip.

What is unclear is how I sum these up into a single Section since each time I create a LineStrip, I get a new Section.

Should I do IKCArray.Add(iSection) for each LineStrip I create, or rather create another ISection2 into which I add each individual LineStrip and finally add the iSection2 into the model ?

Thanks for any info,
Dino

Re: Sets of curves

Posted: Thu Oct 19, 2017 12:44 am
by Prashant Kande
Hi Dino
Line strip section is actually a set of linked strips. You would need to add only one section and inside of it define each strip of the set. See the Index property at http://www.dynoinsight.com/Help/Geom/LineStrips.aspx
Regards

Re: Sets of curves

Posted: Tue Oct 24, 2017 5:51 am
by Dino R
Thank you for the suggestion, Prashant
I got it working, but The Line Thickness needs to be thicker.
could you give me a few hints?

Re: Sets of curves

Posted: Fri Nov 03, 2017 12:14 am
by Prashant Kande
Sorry Dino, I have missed this
Use the ISectionLineStrip.LineWidth() method: http://www.dynoinsight.com/Help/Interfa ... Strip.aspx
Prashant

Re: Sets of curves

Posted: Wed Nov 08, 2017 5:07 am
by Dino R
Good day,

Thanks again for the replies.

1- I spent quite a bit of time on this, to no avail. Have not found yet how to enter all the required points and have separate lines even though coming from the same PointSet.

In the documentation, it is mentioned that the Index should be set to -1 to separate the line segments, but I could not get this to work either.

So, I took another approach, simpler in the end. I will probably face the same situation again in the future, bit for now this is functional.

2- I tried to convert the Lines sample, but not much success - C++ To VB Converter is not very user friendly as it barely converts the basic code, with lots of ToDos and Warnings.

From your comment, now I understand why the Line Thickness does not reply in the Lines sample.

3- Question: if I need to fill the inside of a LineStrip, is this possible or should I think of making several Simplexes. For example, I want to display the following where the contact stress level is given in colors: from blue = 0 to red = maximum. In the PictureBox below, I draw rectangles that I fill. Simple.

But I have not seen anything equivalent in KCad. So, I assume I will need to create Simplexes with the required Fill color. Correct ?

Re: Sets of curves

Posted: Fri Nov 10, 2017 12:07 am
by Prashant Kande
Hi Dino
Sorry the documentation is a bit old there. What can be confusing is that a line strip section implements both ISectionLineStrip and ISectionPointSet. ISectionPointSet manages the point set (ends of segments) data. ISectionLineStrip manages how they are connected and other line properties
1. This: http://www.dynoinsight.com/Prod/Example ... tripVB.zip is a code snippet for creating a two strips section.
2. We will add a VB version of Lines to the next update
3. I do not believe you need “simplexes” for that. You need to set ISectionPointSet.ColorPerVertex to true (the default is false). And change color of each points as needed. Try this running the lines sample in the sample explorer first to see it on the screen first
To set the colors use ISectionPointSet> ISectionPointSet.GetColors()>IMatrixData > Set( indexPoint, colorComponent, colorValue_0to1 )
colorComponent is 0 for red and 2 for blue