Finding center curve of a tube like solid
 1-20  21-36

Next
 From:  HansChristian
10098.1 
Hi everyone

Is it possible to get the center curve or generate one from a tube-like solid? I'm thinking of the possible curve used as rail when using the sweep-function (see below).




Problem:
I have a tube-like solid as pictured below (original) which I made a copy of (Tube) and tried to create the center line manually and then made a sweep with a circle as profile. This didn't go well and was also rather time consuming. At least I can't make it precise so it becomes usable.




The result I'm after is something like the following - I want to keep the shape of the curve but have a different surface and swap the new solid with the old one:




I know it is mathematically possible to get the center or centroid of a surface but is there a function or way to do it in Moi or get the same result with another approach?

In Wikipedia there is an article on how to find the center/centroid for surfaces bot concave and square-like etc. (just to show what I have in mind) https://en.wikipedia.org/wiki/Centroid#By_integral_formula





Last image is just the curve that I tried to model manually.





Any comments or suggestions is highly appreciated

Thanks a lot!

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.2 In reply to 10098.1 
Look at Max Smirnov CVolume2 ;)

http://moi.maxsm.net/files/scripts/CVolume.v.2.0.2015.09.27.zip

Else for very simple Object or surfaces you can use the Helpers line! ;)

EDITED: 4 Jan 2021 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.3 In reply to 10098.2 
Thanks for your help! ;-).

But I don't understand how I can use that script in my situation. I tried it and it seems to make the object smaller or larger depending on the values. Maybe Im not using it right.

Hm helper lines. I have to check that also.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.4 In reply to 10098.3 
You have not posted the 3dm file!!!
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.5 In reply to 10098.4 
Sorry I didn't know I was supposed to.
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.6 In reply to 10098.5 
Not yet reload your file but don't see specific problem :)
(crossing post)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.7 
So no specific problem except you must close the Surfaces / volume for have a solid!
So make planar faces at each side of your volume...Join All...then call Cvolume2

But I don't know if you want really a center of Mass ?

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.8 In reply to 10098.6 
But I need the red line. Not the middle of the ring.


Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.9 In reply to 10098.7 
You misunderstand me. The first sweep example I made was just an example to show what curve I wanted. I dont need the mass or gravity or anything. I just need every calculated centerpoint along the tube like surface that I pictured.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.10 In reply to 10098.8 
So you have yet ? It's the Rail no?

So for have the middle of the curve
Put a Point at the beginning of the Curve and use Array / Curve / 3 ;)

The second point will be the middle of the curve...



But re reading your post i see that is not excatly that you want! :)
So maybe put more points :)

EDITED: 4 Jan 2021 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.11 In reply to 10098.10 
What I need is the center curve for an already made tube like solid so I can change the surface appearance:











  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.12 In reply to 10098.11 
Ok we progress but your volume is made by a Sweep or made by any other method ?

Because if it's made by a Sweep any modify of the rail (s) will made a new volume in real Time :)



If you want Control Points on the curve (rail) : Select the curve (rail), Press Tab , write Rebuild and enter number of Points wanted
Relaunch your Sweep, Move Points etc...

Ps If you Modify the Profil Start / End that will works also but only with generic transformations (move, Scale etc...)
not with a total changement like a "D" to "U" !

EDITED: 4 Jan 2021 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.13 In reply to 10098.12 
The way I got to that was by following Chipp Walter tutorial on solids: https://www.youtube.com/watch?v=jQl-0waABAM

I had some minor changes that was the following: Instead of using a closed curve and thereby slicing a piece of the box out I just separated the piece. Afterwards I took it out and shelled it to remove everything but the tube like outline:

First I booleaned the box with the two open curves.



Result seen in perspective:




Part taken out but before using shell (not needed to show the point).



So I can't see any other way to do what I want than having the center points afterwards some how. I can't get the centerline from the curves because the curves doent go in depth and the box has fillets so there is also some bending after final results.

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10098.14 In reply to 10098.1 
Hi Hans, sorry no there isn't any tool in MoI for calculating a centerline curve like that from an arbitrary tube-like shaped object.

I'm not really sure how that could be calculated.

re:
> I know it is mathematically possible to get the center or centroid of a surface but is there a function or
> way to do it in Moi or get the same result with another approach?

Yes getting the centroid of a surface is doable but for the case you are asking about you don't have a set of surfaces yet. Just finding the set of surfaces for cross sections of your shape is going to be difficult to do already.

There is a thing called the "straight skeleton" of a 2D polygon shape which is a type of centerline.
https://en.wikipedia.org/wiki/Straight_skeleton
I guess there may be some corresponding thing for a polyhedron as well. I'm not familiar with the details of the current research in this area myself though.


re:
> The result I'm after is something like the following - I want to keep the shape of the curve but have a
> different surface and swap the new solid with the old one:

Sorry I'm not really understanding what the end goal is here. Do you want the tube to slice away additional area of base solid to extend the cut out area?

Or is the tube going to sit on top of the solid like as if you put a line of grout squeezed onto it or something like that?


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10098.15 In reply to 10098.13 
Take a look here : https://moi3d.com/forum/index.php?webtag=MOI&msg=8847.20
it was a variation of the Chipp Walters trick ! ;)

Maybe you will obtain the result you want without use a middle curve! :)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Phiro
10098.16 
Hi,

Is this result you wanted ?




Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  renklint
10098.17 
In Grasshopper for Rhino it is possible to get section frames, instersect them with the solid, get the centroids and connect them to a curve.





  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.18 In reply to 10098.16 
Hi Phiro

Yes more or less. How did you do that? Manually?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.19 In reply to 10098.15 
Hi Pilou
It's looks very nice I must say :-). I'm not sure that this would solve the problem in general if the cut out shape is formed by fillets/bevels. I would also like to be able to shape the surface afterwards. For example change the surface from a tube to a more elipse-like shape.

Anyway I can get some inspiration and tricks for Moi in general from you and others in that thread. Thanks!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  HansChristian
10098.20 In reply to 10098.17 
Hi renklint

That looks very interesting. Seems like exactly what I want if I understand it correctly. I have Rhino also (of course as a supplement to Moi ;-) ).

The accuracy of the center curve must be a function of the number of "section frames". When zooming in it looks like a very precise approximation.

Thanks a lot. Do you happend to know where to read more about this?


Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-36