Re: human body geometry

From: Andrei Gheata <Andrei.Gheata_at_cern.ch>
Date: Tue, 23 Oct 2007 13:54:43 +0200


Hi Christian,

Great ! Looks nice so it's candidate #1. I will start a forum thread.

Thanks,
Andrei

Christian Holm Christensen wrote:
> Hi Andrei et al,
>
> On Tue, 2007-10-23 at 10:47 +0200, Andrei Gheata wrote:

>> Hi Akira,
>>
>> No, there isn't but if you make one it will be a perfect candidate to go 
>> in the tutorials ;-)
>> Better: "Best man" made by users till 12 Nov. using the geometry package 
>> will go in the tutorials. All (decent) tries will be posted on the 
>> forum... See $ROOTSYS/tutorials/station1.C or similar for guidance.

>
> Attached is a script that draws a 3D man using TMarker3DBox objects.
> The man is 180cm tall (a "standard" man - at least in Northern
> Europe :-), and faces in the direction the positive z-axis (and obvious
> extension would be to make this a parameter). It's really simple.
> I've also attached a picture of the ALICE ITS, FMD, T0, V0, beam-pipe,
> and absorber nose with a man in it, so that you can get a fell for how
> it looks. The image is not that high in resolution to save band-width.
>
> Yours,
>
>
>
> ------------------------------------------------------------------------
>
> //
> // Script to draw a 3D man (height 180cm) in a 3D view.
> // Copyright (C) 2007 Christian Holm Christensen <cholm_at_nbi.dk>
> //
> // This library is free software; you can redistribute it and/or
> // modify it under the terms of the GNU Lesser General Public
> // License as published by the Free Software Foundation; either
> // version 2.1 of the License, or (at your option) any later
> // version.
> //
> // This library is distributed in the hope that it will be useful,
> // but WITHOUT ANY WARRANTY; without even the implied warranty of
> // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> // Lesser General Public License for more details.
> //
> // You should have received a copy of the GNU Lesser General Public
> // License along with this library; if not, write to the Free
> // Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
> // MA 02110-1301 USA
> //
> void DrawMan(Double_t x0, Double_t y0, Double_t z0, Int_t color)
> {
> // Draw a 3D man using TMarker3DBox (not in the geometry proper), at
> // (x0,y0,z0) with the color color.
> Double_t height = 180;
> TVector3 head(20, 25, 20);
> TVector3 neck(15, 8, 15);
> TVector3 torso(40, 66, 30);
> TVector3 upperArm(8,36,8);
> TVector3 lowerArm(8,30,8);
> TVector3 thigh(15,46,15);
> TVector3 shin(12,30,12);
> TVector3 foot(10,5,25);
> Double_t degrad = TMath::Pi()/180.;
>
> Double_t x = x0;
> Double_t y = y0 + height-head.Y()/2;
> Double_t z = z0;
> TMarker3DBox* headB =
> new TMarker3DBox(x, y, z,head.X()/2,head.Y()/2,head.Z()/2,10,2);
> headB->SetLineColor(color);
> headB->Draw();
>
> y -= head.Y()/2+neck.Y()/2;
> TMarker3DBox* neckB =
> new TMarker3DBox(x,y,z, neck.X()/2,neck.Y()/2,neck.Z()/2,0,0);
> neckB->SetLineColor(color);
> neckB->Draw();
>
> Double_t y1 = y - neck.Y() - TMath::Cos(30*degrad)*upperArm.Y()/2;
> Double_t x1 = ((torso.X()+upperArm.X())/2+
> TMath::Sin(30*degrad)*upperArm.Y()/2);
> TMarker3DBox* upperArmB1 =
> new TMarker3DBox(x0-x1,y1,z, upperArm.X()/2,upperArm.Y()/2,upperArm.Z()/2,
> 0,-30);
> upperArmB1->SetLineColor(color);
> upperArmB1->Draw();
> TMarker3DBox* upperArmB2 =
> new TMarker3DBox(x0+x1,y1,z, upperArm.X()/2,upperArm.Y()/2,upperArm.Z()/2,
> 0,30);
> upperArmB2->SetLineColor(color);
> upperArmB2->Draw();
>
> y1 -= upperArm.Y()/2 + lowerArm.Y()/2;
> TMarker3DBox* lowerArmB1 =
> new TMarker3DBox(x0-x1,y1,z, lowerArm.X()/2,lowerArm.Y()/2,lowerArm.Z()/2,
> 0,30);
> lowerArmB1->SetLineColor(color);
> lowerArmB1->Draw();
> x1 += lowerArm.X();
> TMarker3DBox* lowerArmB2 =
> new TMarker3DBox(x0+x1,y1,z, lowerArm.Z()/2,lowerArm.X()/2,lowerArm.Y()/2,
> -80,80);
> lowerArmB2->SetLineColor(color);
> lowerArmB2->Draw();
>
>
> y -= neck.Y()/2+torso.Y()/2;
> TMarker3DBox* torsoB =
> new TMarker3DBox(x, y, z, torso.X()/2,torso.Y()/2,torso.Z()/2,0,0);
> torsoB->SetLineColor(color);
> torsoB->Draw();
>
>
> y -= torso.Y()/2+thigh.Y()/2;
> x = (torso.X() - thigh.X())/2;
> TMarker3DBox* thighB1 =
> new TMarker3DBox(x0-x,y,z, thigh.X()/2,thigh.Y()/2,thigh.Z()/2,0,0);
> thighB1->SetLineColor(color);
> thighB1->Draw();
>
> TMarker3DBox* thighB2 =
> new TMarker3DBox(x0+x,y,z,thigh.Z()/2,thigh.X()/2,thigh.Y()/2,80,-80);
> thighB2->SetLineColor(color);
> thighB2->Draw();
>
>
> y -= thigh.Y()/2+shin.Y()/2;
> TMarker3DBox* shinB1 =
> new TMarker3DBox(x0-x,y,z, shin.X()/2,shin.Y()/2,shin.Z()/2,0,0);
> shinB1->SetLineColor(color);
> shinB1->Draw();
> x += TMath::Sin(10*degrad)*thigh.X();
> z += TMath::Sin(10*degrad)*thigh.Z();
> TMarker3DBox* shinB2 =
> new TMarker3DBox(x0+x,y,z, shin.X()/2,shin.Y()/2,shin.Z()/2,0,0);
> shinB2->SetLineColor(color);
> shinB2->Draw();
>
> y -= shin.Y()/2+foot.Y()/2;
> x = (torso.X() - thigh.X())/2;
> z = z0 + foot.Z()/2 - shin.Z()/2;
> TMarker3DBox* footB1 =
> new TMarker3DBox(x0-x,y,z, foot.X()/2,foot.Y()/2,foot.Z()/2,0,0);
> footB1->SetLineColor(color);
> footB1->Draw();
> x += TMath::Sin(10*degrad)*thigh.X();
> z += TMath::Sin(10*degrad)*thigh.X();
> TMarker3DBox* footB2 =
> new TMarker3DBox(x0+x,y,z, foot.X()/2,foot.Y()/2,foot.Z()/2,0,0);
> footB2->SetLineColor(color);
> footB2->Draw();
> }
> //
> // EOF
> //
>
>
> ------------------------------------------------------------------------
>
Received on Tue Oct 23 2007 - 13:55:01 CEST

This archive was generated by hypermail 2.2.0 : Tue Oct 23 2007 - 17:50:01 CEST