View Full Version : Mesh
sp
10th Apr 2003, 12:20 pm
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????
fuccaro
10th Apr 2003, 02:22 pm
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?
sp
10th Apr 2003, 03:30 pm
tell me how to insert a picture and i'll show you what i need
CADTutor
10th Apr 2003, 04:12 pm
Hmm... not much of a bargain.
See this: http://www.cadtutor.net/acad/acad2k/map/map.html
sp
10th Apr 2003, 05:02 pm
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.
sp
23rd Apr 2003, 12:25 pm
: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...
fuccaro
23rd Apr 2003, 02:36 pm
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.
sp
23rd Apr 2003, 06:31 pm
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
fuccaro
24th Apr 2003, 06:03 am
To post your image you may try this:
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
fuccaro
2nd May 2003, 12:08 pm
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...
; The centroid of a surface
; The surface must be open in N and in M direction!
; mfuccaro@hotmail.com
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 02.05.2003;;;;;;;;
(defun c:centr( / p1 p2 p3 p4 pa pb pc pd)
(setq sx 0 sy 0 sz 0 area 0)
(setq trash (ssadd))
(defun area1(a b c) ;area of triangle abc
(command "3dpoly" a b c "c")
(ssadd (entlast) trash)
(setq p (* 0.5 (+ (setq l1 (distance a b)) (setq l2 (distance b c)) (setq l3 (distance a c)))))
(sqrt (* p (- p l1) (- p l2) (- p l3))) ;Heron
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq ent (car (entsel "\nselect mesh..."))
entlist (entget ent)
m (cdr (assoc 71 entlist))
n (cdr (assoc 72 entlist)))
(setq p1 (entnext ent))
(repeat (1- m)
(repeat (1- n)
(setq p2 (entnext p1) p3 p2)
(repeat (1- n) (setq p3 (entnext p3)))
(setq p4 (entnext p3))
(setq pa (cdr (assoc 10 (entget p1)))
pb (cdr (assoc 10 (entget p2)))
pc (cdr (assoc 10 (entget p3)))
pd (cdr (assoc 10 (entget p4)))
a1 (area1 pa pb pc)
a2 (area1 pb pc pd)
area (+ area a1 a2)
sx (+ (* a1 (/ (+ (car pa) (car pb) (car pc)) 3.0))
(* a2 (/ (+ (car pb) (car pc) (car pd)) 3.0))
sx)
sy (+ (* a1 (/ (+ (cadr pa) (cadr pb) (cadr pc)) 3.0))
(* a2 (/ (+ (cadr pb) (cadr pc) (cadr pd)) 3.0))
sy)
sz (+ (* a1 (/ (+ (caddr pa) (caddr pb) (caddr pc)) 3.0))
(* a2 (/ (+ (caddr pb) (caddr pc) (caddr pd)) 3.0))
sz))
(setq p1 p2)
) ;repeat (1- n)
(setq p1 (entnext p1))
) ;repeat (1- m)
(setq centroid (list (/ sx area) (/ sy area) (/ sz area)))
)
(princ "Program loaded. Type CENTR at the command prompt")
That Idea works good for small single plates. But the reason again for the solids is for weight and the center of gravity. The way I had got it to work was that the mesh is divide into rectanangles, if your surf tab is set to 100 even on a curved surface I would do a 3 piont ucs and draw a p-line around each rectangle, then extrude just that rectangle....then move on to the next rectangle and repeat an so on. this is very boring and time consuming but again it does what I need to get done. It finds the center of gravity and gives me a weight. Now mind you I am not just doing this to the mesh, I have a 120 ton unit( section of a ship) that is included in this massprop command. Hundreds of brackets and diffrent parts all together as long as each one is a solid I can find the Centroid. that is why I need the mesh a solid as well. When I do massprop on my unit right now everything but the side shell "mesh" is selected. I was just hoping that someone could of helped with a lisp forwhat I'm asking..I'll try my hand at it even though I'm still learning Lisp routines.
fuccaro
2nd May 2003, 01:06 pm
SP
If you have some closed polylines in planes with different orientation and at the command EXTRUDE you select them all, the extrusion will work correctly. Each polilyne will be extruded along a direction perpendicular on the polyline plan. Probable I was not clear enough in my last post: use the routine I wrote for you. The mesh will be cowered with triangles. With a single EXTRUDE command you can transform all the triangles in solids. I suggested you to use two extrusions for keeping the mesh in the middle of the solid. You do not need to change the UCS. The difference between the method you use and this one is that I created two triangles for each of "your" rectangle
sp
12th May 2003, 03:38 pm
The lisp routine that you have written works good but it does have a few flaws I ran it on some curved plate and some triangles extruded in the opposite dirrection. but in all aspects it works out ok. I applaude you and cheers that ever so much you da bomb....
fuccaro
13th May 2003, 05:40 am
SP
I am happy to know that it works.
Please read again the previous posts: extruding the triangles with HALF of the needed extrusion length and extruding them again with MINUS HALF of the length you will get the correct solid. The original mesh will be placed INSIDE at the half distance from the surfaces of the solid.
Cheers!
fuccaro
14th May 2003, 05:35 am
SP
A very funny thing is happened: forget the lisp routine I wrote for you, it is useless from now. I just discovered a quick method to do the job just with a few clicks. If you are curious please follow this few steps:
1 Zoom until all the mesh is on the screen
2 At the command prompt type DELOBJ and answer with 0 when you are prompted for the new value.
3 Explode the mesh. The explosion is irreversible so probable you will wish to make a copy first.
4 Type EXTRUDE. Select objects: select all the 3D faces resulted from the explosion of the mesh.
5 Height of extrusion: 7; taper angle: 0
6 Press enter to repeat the extrusion. Select objects: answer with P for the previous selection set.
7 Height of extrusion: -7; taper angle: 0
8 Union all the solids.
9 restore DELOBJ at the initial value (1)
now you got a solid with thickness (7+7=) 14
How much times my advice is speeding up your work? I will think at you switching the UCS... drawing a rectangle... extruding that rectangle... switching... (no offense SP!)
Probable you will think at me writing the lisp, trying ... modifying ... trying again ...
If you will cam in Romania we will drink a bier together. What do you say?
sp
16th May 2003, 02:45 pm
Fuccaro,
Thanks ever so much, It does speed my process. i would love to drink with you one day! I live in a little community in Louisiana USA. Kind of far away......I work at a very large Shipyard heres a site that you will find our large anchorhandler vessel that we recently did.
Web Page http://www.chouest.com
scj
23rd Oct 2003, 12:28 pm
Hi sp,
to create SOLID's laying between twisted surfaces (ship boards) I wrote a LISP. In case of interest contact me via www.black-cad.de
Regards
Jochen
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.