1. ## Mesh

Hello,

I've seen the m2s command and used it, it works but I need something a little different. In my line of work we create large ships in shipconstructor using solids and mesh to produce units up to 200 tons. proplem is when our yard needs to flip a large unit over they request the centriod or the center of gravity so they can place their flipping padeyes to catch with the cranes. All solids give us wieghts but mesh does not. the m2s command works on a flat plane and not curved sufaces such as the shape of the front of a supply vessel. Is there any way to convert a curved mesh to a solid????

2. Just my opinion: convert the mesh to solid using the m2s lisp routine. Use the SOLIDEDIT command to transform your solid in a SHELL (SOLIDEDIT > BODY > SHELL). The “inside” of the solid will be replaced by a “hole” and the solid will be like a curved metal sheet with the desired thickness. Is it what you need?

3. tell me how to insert a picture and i'll show you what i need

4. Hmm... not much of a bargain.

5. ## mesh

Thats not what i meant. I know how to render and insert pics into drawings I just don't see a place on this form to insert my work to show you what i am talking about. I saw a picture of the spiral and of a gear I want to put up my mesh so you could understand want i'm trying to do.

6. :idea: After looking at my problem.... the easiest way to do this would be to take the mesh lets say the surftab is set at 200, then I would need to redraw each rectangle as a p-line all around the surface"could be a 3-d poly" of each if the 200 rectangles in the mesh and then extrude the thickness of the desired plate. Then I would have 200 individule rectangales that are lets say 1/2" thick. Then I could union these together and wola a curved surface is a solid. Granted that in some areas the edges might not extactly connect on one side because of curve but it does the trick for finding the centriod. Now I did this manualy and it took a great amount of time to do.....Question :?: Could someone maybe look into this and maybe write a lisp...

7. ## try again!

SP
The way you described is a time consuming and an inexact method to find-out the centroid. The extrude command will not work on 3DPOLY entities –unless in the particular case when all vertexes are in the same plane. Please try to reevaluate my first answer. I constructed a mesh and I used the m2s routine to convert it to a solid. At this step the routine will add new surfaces. I turned the solid in a shell using SOLIDEDIT > BODY > SHELL. When I was prompted REMOVE FACES I selected the unwanted faces I mentioned before. I got the hull of a boat with desired thickness (however, how I imagine a boat looks like).
I anticipate a problem here: if the mesh is very complicated the m2s will not convert it correct. In this case divide your mesh in smaller surfaces (all must be convex) and convert them one by one.
Or maybe you wish to try an other method:
Do you construct your mesh starting from some curves? Each time you draw a curve, draw an other one using the OFFSET command. Use the desired thickness as offset distance. So you can construct two surfaces. Using the m2s lisp routine you can convert them to solids. Substract the inner solid from the outer one. This means double work to construct the mesh and 200 times less work to obtain the solid.
Or even the double work can be avoided: convert the mesh to solid (m2s) and make a copy in the same place. Move the copy to an other layer and turn off that layer. Use SOLIDEDIT > FACES > OFFSET on your solid. When prompted select only the faces belonging to the original mesh and do not select the unwanted faces new created. Probably you will find easy to select ALL faces at first and to remove than he unwanted ones from the selection set. Type a negative value as offset distance –the desired thickness. Turn on the layer containing the copy of the solid. Substract the smaller solid from the copy.
Play around with this, I am sure you will find a way to improve your job.

8. When I do the shell command it leaves a empty box in place of an shell plate that I want. Now I do know that what i'm saying is time consumming but it works. I was hoping that someone who knows lisp could maybe help out. In order to extrude around some 3-d polys, i had to first get a 3-piont ucs then draw a p-line then was able to extrude. If someone would help me with a site to post a picture i will show yall what i mean. Lets say the front of a ship, it has various curvers and contours and nothing is just offset in real life. I am trying to do this just for the weight and not apperance. I can get weights on solids but not mesh so it is important that i do this for placement of 100 ton cranes.

I do apprecate the help.............L8R

9. To post your image you may try this:
Originally Posted by superjari
Another option is www.picserver.tk, it will allow remote linking...
Maybe you will insert a picture of the "empty box" what you got after using the SOLIDEDIT > SHELL command

10. Registered forum members do not see this ad.

Hello SP!
I think it is possible to calculate the centroid of a surface, even without to convert it to a solid. Covering the whole surface of the mesh with triangles the centroid of the surface can be calculated with the formula
Xc=(A1*X1+A2*X2+ ... +An*Xn) / (A1+A2+ ... +An)
Ai is the area of the triangle i
Xi is the X coordinate of the centroid of the triangle i
In the same manner can be calculated the Yc and the Zc coordinates for the centroid. Here is a Lisp routine for. It works for open surfaces only.
Advice: set as current a different color as your mesh is (even set as current a new layer). Load the routine and type CENTR at the command prompt. Select the mesh when prompted. It will be covered with triangles. Check careful if the whole mesh is covered! The centroid is displayed at the command line. Also it is stored in a variable named CENTROID, so when AutoCAD expects a point from you (to insert a block for example) you may answer by typing !CENTROID –but only in this drawing session. Also you can get the area typing !AREA. To delete the triangles use the ERASE command. When AutoCAD prompts you SELECT OBJECTS answer with !TRASH and all the triangles will be selected.
I am sure you have some old works –surfaces with all ready calculated centroids – for test the routine.
If you wish to work in your way by converting the mesh in a solid with thickness s, follow these steps:
Run the Lisp routine.
Set the DELOBJ at zero.
Type EXTRUDE. Select objects: !TRASH. Height of extrusion: s/2, taper angle: zero.
Type EXTRUDE again, select objects: P height of extrusion: -s/2 taper angle: 0
Aufcourse you must calculate the half of the thickness before; typing s/2 you will got an error message.
The rest is up to you...
Code:
```;          The centroid of a surface
;  The surface must be open in N and in M direction!
;                            mfuccaro@hotmail.com
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 02.05.2003;;;;;;;;
&#40;defun c&#58;centr&#40; / p1 p2 p3 p4 pa pb pc pd&#41;
&#40;setq sx 0 sy 0 sz 0 area 0&#41;

&#40;defun area1&#40;a b c&#41; ;area of triangle abc
&#40;command "3dpoly" a b c "c"&#41;
&#40;setq p &#40;* 0.5 &#40;+ &#40;setq l1 &#40;distance a b&#41;&#41; &#40;setq l2 &#40;distance b c&#41;&#41; &#40;setq l3 &#40;distance a c&#41;&#41;&#41;&#41;&#41;
&#40;sqrt &#40;* p &#40;- p l1&#41; &#40;- p l2&#41; &#40;- p l3&#41;&#41;&#41; ;Heron
&#41;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
&#40;setq ent &#40;car &#40;entsel "\nselect mesh..."&#41;&#41;
entlist &#40;entget ent&#41;
m &#40;cdr &#40;assoc 71 entlist&#41;&#41;
n &#40;cdr &#40;assoc 72 entlist&#41;&#41;&#41;
&#40;setq p1 &#40;entnext ent&#41;&#41;
&#40;repeat &#40;1- m&#41;
&#40;repeat &#40;1- n&#41;
&#40;setq p2 &#40;entnext p1&#41; p3 p2&#41;
&#40;repeat &#40;1- n&#41; &#40;setq p3 &#40;entnext p3&#41;&#41;&#41;
&#40;setq p4 &#40;entnext p3&#41;&#41;
&#40;setq pa &#40;cdr &#40;assoc 10 &#40;entget p1&#41;&#41;&#41;
pb &#40;cdr &#40;assoc 10 &#40;entget p2&#41;&#41;&#41;
pc &#40;cdr &#40;assoc 10 &#40;entget p3&#41;&#41;&#41;
pd &#40;cdr &#40;assoc 10 &#40;entget p4&#41;&#41;&#41;
a1 &#40;area1 pa pb pc&#41;
a2 &#40;area1 pb pc pd&#41;
area &#40;+ area a1 a2&#41;
sx &#40;+ &#40;* a1 &#40;/ &#40;+ &#40;car pa&#41; &#40;car pb&#41; &#40;car pc&#41;&#41; 3.0&#41;&#41;
&#40;* a2 &#40;/ &#40;+ &#40;car pb&#41; &#40;car pc&#41; &#40;car pd&#41;&#41; 3.0&#41;&#41;
sx&#41;
sy&#41;
sz&#41;&#41;
&#40;setq p1 p2&#41;
&#41;  ;repeat &#40;1- n&#41;
&#40;setq p1 &#40;entnext p1&#41;&#41;
&#41;   ;repeat &#40;1- m&#41;
&#40;setq centroid &#40;list &#40;/ sx area&#41; &#40;/ sy area&#41; &#40;/ sz area&#41;&#41;&#41;
&#41;
&#40;princ "Program loaded. Type CENTR at the command prompt"&#41;```

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts