00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <stdio.h>
00042 #include "memvirtu.h"
00043 #include "lowparam.h"
00044 #include "lowsolid.h"
00045 #include "eulerops.h"
00046 #include "mancommd.h"
00047 #include "shpshape.h"
00048
00049 SPTYPE MSD_lowMakePrism0(Id sn, XY *listvtx, int n, int pln)
00050 {
00051 SPTYPE s;
00052 int flag = 0, GOld;
00053
00054 GOld = Gdoinversion;
00055 Gdoinversion = FALSE;
00056 CommandCount++;
00057 if ((s = MSD_lowMakePolygon(sn, listvtx, n, pln)) != SNIL)
00058 {
00059 flag = 1;
00060 MSD_lowSetNormal(s, TRUE);
00061 MSD_lowSetEdgeAngle(s);
00062 MSD_lowSetInfo(s);
00063 MSD_lowAddEulerOp(s, HARDREM, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0);
00064 }
00065 Gdoinversion = GOld;
00066 return(flag == 0 ? SNIL : s);
00067 }
00068
00069 SPTYPE MSD_lowMakePolygon(Id sn, XY *listvtx, int n, int pln)
00070 {
00071 SPTYPE s;
00072 int i, flag = 1;
00073 real x, y, z;
00074
00075 x = listvtx->x;
00076 y = pln == 1 ? listvtx->y : 0.0;
00077 z = pln == 2 ? listvtx->y : 0.0;
00078 if ((s = MSD_lowMVSF(sn, maxf++, maxv++, maxd++, x, y, z)) == SNIL)
00079 {
00080 flag = 0;
00081 }
00082 for (i = 1; i < n; i++)
00083 {
00084 x = (listvtx + i)->x;
00085 y = pln == 1 ? (listvtx + i)->y : 0.0;
00086 z = pln == 2 ? (listvtx + i)->y : 0.0;
00087 if (MSD_highMEV(sn, maxf - 1, maxv - 1, maxv, x, y, z) == ERROR)
00088 {
00089 flag = 0;
00090 }
00091 maxv++;
00092 }
00093 if (MSD_highMEF(sn, maxv - n, maxv - 1, maxf - 1, maxf) == ERROR)
00094 {
00095 flag = 0;
00096 }
00097 maxf++;
00098 if (flag == 1)
00099 {
00100 MSD_lowSetNormal(s, TRUE);
00101 }
00102 if (flag == 0)
00103 {
00104 MSD_lowHardRemove(s);
00105 }
00106 return(flag == 0 ? SNIL : s);
00107 }