+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Mesh

  1. #1
    Full Member
    Using
    AutoCAD 2011
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    35

    Default Mesh

    Registered forum members do not see this ad.

    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. #2
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543

    Default

    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?
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  3. #3
    Full Member
    Using
    AutoCAD 2011
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    35

    Default

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

  4. #4
    Administrator CADTutor's Avatar
    Computer Details
    CADTutor's Computer Details
    Operating System:
    Windows 7 Home Premium 64bit
    Motherboard:
    Asus P7P55D-E PRO
    CPU:
    Intel Core i7-860
    RAM:
    4GB PC3-12800 C8 Corsair Dominator
    Graphics:
    NVIDIA Quadro FX 1800 768 MB
    Primary Storage:
    Intel X25-M SSD 160GB
    Secondary Storage:
    Samsung Spinpoint 320GB
    Monitor:
    BenQ FP241W 24" Wide
    Discipline
    Education
    CADTutor's Discipline Details
    Occupation
    Senior Lecturer (Digital Design), Landscape Architect & Web Designer
    Discipline
    Education
    Using
    AutoCAD 2015
    Join Date
    Aug 2002
    Location
    Hampshire, UK
    Posts
    3,689

    Default

    Hmm... not much of a bargain.

    See this: http://www.cadtutor.net/acad/acad2k/map/map.html
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
    AutoCAD Tutorials | How to add images to your posts | How to register successfully | Forum FAQ

  5. #5
    Full Member
    Using
    AutoCAD 2011
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    35

    Default 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. #6
    Full Member
    Using
    AutoCAD 2011
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    35

    Default

    :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. #7
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543

    Default 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.
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  8. #8
    Full Member
    Using
    AutoCAD 2011
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    35

    Default

    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. #9
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543

    Default

    To post your image you may try this:
    Quote 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
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  10. #10
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543

    Default

    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;;;;;;;;
    (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")
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

Bookmarks

Posting Permissions

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