Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial cylindrical unfolding #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified unfolder
Binary file not shown.
38 changes: 38 additions & 0 deletions unfolder.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ void cylindre(void)
}
}
}
<<<<<<< HEAD

=======
>>>>>>> r03ert0/master
void sphere(void)
{
int i,j,n=0;
Expand Down Expand Up @@ -392,7 +396,10 @@ void sphere(void)
R=r;
}
}
<<<<<<< HEAD
=======

>>>>>>> r03ert0/master
// apply spherical transformation
for(j=0;j<hdr.n_count;j++)
if(m[j])
Expand All @@ -415,13 +422,24 @@ void sphere(void)
}
}
}
<<<<<<< HEAD

void partialCylindre(float theta)
{
/*
partial cylindrical transformation.
The parametre t varies from 0 to pi/2.
A value t=0 produces no transformation, and a
value of t=pi/2 produces the complete cylindrical
=======
void partialCylindre(float alpha)
{
/*
partial cylindrical transformation.
The parametre alpha varies from 0 to pi/2.
A value alpha=pi/2 produces no transformation, and a
value of alpha=0 produces the complete cylindrical
>>>>>>> r03ert0/master
transformation.
*/
int i,j,n=0;
Expand Down Expand Up @@ -458,10 +476,14 @@ transformation.
H=H*2;

// apply cylindrical transformation
<<<<<<< HEAD
float d,x1,y1,b;
=======
float r1;
float d1;
float a1;
float x1,y1;
>>>>>>> r03ert0/master
for(j=0;j<hdr.n_count;j++)
if(m[j])
{
Expand All @@ -471,6 +493,18 @@ transformation.
r=sqrt(pow(p[i].x-origin.x,2)+pow(p[i].y-origin.y,2));
a=atan2(p[i].y-origin.y,p[i].x-origin.x);

<<<<<<< HEAD
/* this is the part that does the partial transformation */
if(theta>0.00001)
d=(kPI*r)*sin(theta)/theta;
else
d=kPI*r;
b=theta*a/kPI;
x1=r-d*cos(b);
y1=d*sin(b);
p[i]=(float3D){x1,y1,p[i].z};
/* ----------------------------------------------------- */
=======
/* This is the part that does the partial transformation */
/* ----------------------------------------------------- */
/*
Expand Down Expand Up @@ -507,6 +541,7 @@ transformation.
/* ----------------------------------------------------- */

p[i]=(float3D){x1,y1,p[i].z};
>>>>>>> r03ert0/master
}
}
}
Expand Down Expand Up @@ -627,8 +662,11 @@ int main(int argc, char *argv[])
}
fclose(f);
free(pr);
<<<<<<< HEAD
=======

// process command line switches
>>>>>>> r03ert0/master
for(i=2+braingl;i<argc;i++)
{
printf("%s\n",argv[i]);
Expand Down