1
$\begingroup$

I have been building a complex mathematical object in Blender by creating each individual vertex and then connecting the dots. There are 260 vertices. I'm currently on #38. Obviously this is not efficient. I know there is a way to import this data, or write the script, but I have no idea where to start. I'm a complete beginner on Blender, and know almost nothing about Python. The data I'm working from looks like this...

This is the entire file:

Dual Geodesic Icosahedron Pattern 6 [3,1]

C0  = 0.0278728483334650370381795124317
C1  = 0.0417605902707273450330202218460
C2  = 0.0482207631985655347048259575806
C3  = 0.0485271500913616902083332985770
C4  = 0.0931391956773255725056107681612
C5  = 0.0965573626835274272370348719303
C6  = 0.107547404625872186617181540007
C7  = 0.115790817646860551951256687036
C8  = 0.119783424089466474929919797595048
C9  = 0.145586591764509108593032943711
C10 = 0.1455928882670341471433303052049
C11 = 0.194113741855870798801366242288
C12 = 0.220431462018603598005258179308
C13 = 0.238188705049775063930022711304
C14 = 0.239202575383431558854091591763
C15 = 0.258249788916612246877163454031
C16 = 0.267154551763824439262804947967
C17 = 0.283287921016592357037529251132
C18 = 0.298950040243594377815031134048
C19 = 0.324717740377238927017176093829
C20 = 0.332341771060757131359702359924
C21 = 0.334746067733302491167057583234
C22 = 0.358695307225219637200425804924
C23 = 0.379845283700119784274564123062
C24 = 0.405175083258563434157399921336
C25 = 0.405192747827293817829885928720
C26 = 0.413270268840324805049177290081
C27 = 0.430496636473677061118504317477
C28 = 0.435184175960922907431325584883
C29 = 0.446935673529290779190420143182
C30 = 0.506357127147255998116896539729
C31 = 0.524958507348029909087319718931
C32 = 0.534514094024825642786011006694
C33 = 0.550779339591802926422918872431
C34 = 0.569503363526322938881495682523
C35 = 0.580381198695491106718671839452
C36 = 0.586729731159675194950822709919
C37 = 0.592528561796324926333750448387
C38 = 0.629297917816793706232691827171
C39 = 0.640749324994890461038576405968
C40 = 0.645287686083513420132210630583
C41 = 0.657059511437996058376878453752
C42 = 0.670748229742154172402305457529
C43 = 0.711755637544140100272223270381
C44 = 0.719275379833515862610638756106
C45 = 0.764606916063868244994059993760
C46 = 0.765242704206979552285561900711
C47 = 0.771377873753784688028391160270
C48 = 0.793115552540444589323741413143
C49 = 0.801179944373958283220464778439
C50 = 0.804894833221465672777834038542
C51 = 0.824918436209450258880845421223
C52 = 0.8429405346446856282534850002848
C53 = 0.849729379835397304237950006479
C54 = 0.8527912845429152959190249336546
C55 = 0.8911612978432511629583109578654
C56 = 0.912442237847337859395015578549
C57 = 0.9169707620208188351717214654752
C58 = 0.939076505920710743919097644376
C59 = 0.939706841852119460615896935414
C60 = 0.969698269985748550217336591577
C61 = 0.970005426460752347149386724411

V0   = (  C5,   C0,  1.0)
V1   = (  C5,  -C0, -1.0)
V2   = ( -C5,  -C0,  1.0)
V3   = ( -C5,   C0, -1.0)
V4   = ( 1.0,   C5,   C0)
V5   = ( 1.0,  -C5,  -C0)
V6   = (-1.0,  -C5,   C0)
V7   = (-1.0,   C5,  -C0)
V8   = (  C0,  1.0,   C5)
V9   = (  C0, -1.0,  -C5)
V10  = ( -C0, -1.0,   C5)
V11  = ( -C0,  1.0,  -C5)
V12  = ( C14,  -C6,  C61)
V13  = ( C14,   C6, -C61)
V14  = (-C14,   C6,  C61)
V15  = (-C14,  -C6, -C61)
V16  = ( C61, -C14,   C6)
V17  = ( C61,  C14,  -C6)
V18  = (-C61,  C14,   C6)
V19  = (-C61, -C14,  -C6)
V20  = (  C6, -C61,  C14)
V21  = (  C6,  C61, -C14)
V22  = ( -C6,  C61,  C14)
V23  = ( -C6, -C61, -C14)
V24  = (  C9,  C12,  C60)
V25  = (  C9, -C12, -C60)
V26  = ( -C9, -C12,  C60)
V27  = ( -C9,  C12, -C60)
V28  = ( C60,   C9,  C12)
V29  = ( C60,  -C9, -C12)
V30  = (-C60,  -C9,  C12)
V31  = (-C60,   C9, -C12)
V32  = ( C12,  C60,   C9)
V33  = ( C12, -C60,  -C9)
V34  = (-C12, -C60,   C9)
V35  = (-C12,  C60,  -C9)
V36  = ( C11, -C18,  C59)
V37  = ( C11,  C18, -C59)
V38  = (-C11,  C18,  C59)
V39  = (-C11, -C18, -C59)
V40  = ( C59, -C11,  C18)
V41  = ( C59,  C11, -C18)
V42  = (-C59,  C11,  C18)
V43  = (-C59, -C11, -C18)
V44  = ( C18, -C59,  C11)
V45  = ( C18,  C59, -C11)
V46  = (-C18,  C59,  C11)
V47  = (-C18, -C59, -C11)
V48  = ( 0.0,  C22,  C58)
V49  = ( 0.0,  C22, -C58)
V50  = ( 0.0, -C22,  C58)
V51  = ( 0.0, -C22, -C58)
V52  = ( C58,  0.0,  C22)
V53  = ( C58,  0.0, -C22)
V54  = (-C58,  0.0,  C22)
V55  = (-C58,  0.0, -C22)
V56  = ( C22,  C58,  0.0)
V57  = ( C22, -C58,  0.0)
V58  = (-C22,  C58,  0.0)
V59  = (-C22, -C58,  0.0)
V60  = ( C24,  -C2,  C57)
V61  = ( C24,   C2, -C57)
V62  = (-C24,   C2,  C57)
V63  = (-C24,  -C2, -C57)
V64  = ( C57, -C24,   C2)
V65  = ( C57,  C24,  -C2)
V66  = (-C57,  C24,   C2)
V67  = (-C57, -C24,  -C2)
V68  = (  C2, -C57,  C24)
V69  = (  C2,  C57, -C24)
V70  = ( -C2,  C57,  C24)
V71  = ( -C2, -C57, -C24)
V72  = ( C20,  C15,  C56)
V73  = ( C20, -C15, -C56)
V74  = (-C20, -C15,  C56)
V75  = (-C20,  C15, -C56)
V76  = ( C56,  C20,  C15)
V77  = ( C56, -C20, -C15)
V78  = (-C56, -C20,  C15)
V79  = (-C56,  C20, -C15)
V80  = ( C15,  C56,  C20)
V81  = ( C15, -C56, -C20)
V82  = (-C15, -C56,  C20)
V83  = (-C15,  C56, -C20)
V84  = ( C29,   C7,  C55)
V85  = ( C29,  -C7, -C55)
V86  = (-C29,  -C7,  C55)
V87  = (-C29,   C7, -C55)
V88  = ( C55,  C29,   C7)
V89  = ( C55, -C29,  -C7)
V90  = (-C55, -C29,   C7)
V91  = (-C55,  C29,  -C7)
V92  = (  C7,  C55,  C29)
V93  = (  C7, -C55, -C29)
V94  = ( -C7, -C55,  C29)
V95  = ( -C7,  C55, -C29)
V96  = ( C21, -C26,  C54)
V97  = ( C21,  C26, -C54)
V98  = (-C21,  C26,  C54)
V99  = (-C21, -C26, -C54)
V100 = ( C54, -C21,  C26)
V101 = ( C54,  C21, -C26)
V102 = (-C54,  C21,  C26)
V103 = (-C54, -C21, -C26)
V104 = ( C26, -C54,  C21)
V105 = ( C26,  C54, -C21)
V106 = (-C26,  C54,  C21)
V107 = (-C26, -C54, -C21)
V108 = (  C3,  C32,  C53)
V109 = (  C3, -C32, -C53)
V110 = ( -C3, -C32,  C53)
V111 = ( -C3,  C32, -C53)
V112 = ( C53,   C3,  C32)
V113 = ( C53,  -C3, -C32)
V114 = (-C53,  -C3,  C32)
V115 = (-C53,   C3, -C32)
V116 = ( C32,  C53,   C3)
V117 = ( C32, -C53,  -C3)
V118 = (-C32, -C53,   C3)
V119 = (-C32,  C53,  -C3)
V120 = ( C31, -C10,  C52)
V121 = ( C31,  C10, -C52)
V122 = (-C31,  C10,  C52)
V123 = (-C31, -C10, -C52)
V124 = ( C52, -C31,  C10)
V125 = ( C52,  C31, -C10)
V126 = (-C52,  C31,  C10)
V127 = (-C52, -C31, -C10)
V128 = ( C10, -C52,  C31)
V129 = ( C10,  C52, -C31)
V130 = (-C10,  C52,  C31)
V131 = (-C10, -C52, -C31)
V132 = ( C23,  C27,  C51)
V133 = ( C23, -C27, -C51)
V134 = (-C23, -C27,  C51)
V135 = (-C23,  C27, -C51)
V136 = ( C51,  C23,  C27)
V137 = ( C51, -C23, -C27)
V138 = (-C51, -C23,  C27)
V139 = (-C51,  C23, -C27)
V140 = ( C27,  C51,  C23)
V141 = ( C27, -C51, -C23)
V142 = (-C27, -C51,  C23)
V143 = (-C27,  C51, -C23)
V144 = ( C30, -C19,  C50)
V145 = ( C30,  C19, -C50)
V146 = (-C30,  C19,  C50)
V147 = (-C30, -C19, -C50)
V148 = ( C50, -C30,  C19)
V149 = ( C50,  C30, -C19)
V150 = (-C50,  C30,  C19)
V151 = (-C50, -C30, -C19)
V152 = ( C19, -C50,  C30)
V153 = ( C19,  C50, -C30)
V154 = (-C19,  C50,  C30)
V155 = (-C19, -C50, -C30)
V156 = ( C37,   C8,  C49)
V157 = ( C37,  -C8, -C49)
V158 = (-C37,  -C8,  C49)
V159 = (-C37,   C8, -C49)
V160 = ( C49,  C37,   C8)
V161 = ( C49, -C37,  -C8)
V162 = (-C49, -C37,   C8)
V163 = (-C49,  C37,  -C8)
V164 = (  C8,  C49,  C37)
V165 = (  C8, -C49, -C37)
V166 = ( -C8, -C49,  C37)
V167 = ( -C8,  C49, -C37)
V168 = ( C13,  C34,  C48)
V169 = ( C13, -C34, -C48)
V170 = (-C13, -C34,  C48)
V171 = (-C13,  C34, -C48)
V172 = ( C48,  C13,  C34)
V173 = ( C48, -C13, -C34)
V174 = (-C48, -C13,  C34)
V175 = (-C48,  C13, -C34)
V176 = ( C34,  C48,  C13)
V177 = ( C34, -C48, -C13)
V178 = (-C34, -C48,  C13)
V179 = (-C34,  C48, -C13)
V180 = ( C39,  -C1,  C47)
V181 = ( C39,   C1, -C47)
V182 = (-C39,   C1,  C47)
V183 = (-C39,  -C1, -C47)
V184 = ( C47, -C39,   C1)
V185 = ( C47,  C39,  -C1)
V186 = (-C47,  C39,   C1)
V187 = (-C47, -C39,  -C1)
V188 = (  C1, -C47,  C39)
V189 = (  C1,  C47, -C39)
V190 = ( -C1,  C47,  C39)
V191 = ( -C1, -C47, -C39)
V192 = ( C17, -C36,  C46)
V193 = ( C17,  C36, -C46)
V194 = (-C17,  C36,  C46)
V195 = (-C17, -C36, -C46)
V196 = ( C46, -C17,  C36)
V197 = ( C46,  C17, -C36)
V198 = (-C46,  C17,  C36)
V199 = (-C46, -C17, -C36)
V200 = ( C36, -C46,  C17)
V201 = ( C36,  C46, -C17)
V202 = (-C36,  C46,  C17)
V203 = (-C36, -C46, -C17)
V204 = (  C4, -C40,  C45)
V205 = (  C4,  C40, -C45)
V206 = ( -C4,  C40,  C45)
V207 = ( -C4, -C40, -C45)
V208 = ( C45,  -C4,  C40)
V209 = ( C45,   C4, -C40)
V210 = (-C45,   C4,  C40)
V211 = (-C45,  -C4, -C40)
V212 = ( C40, -C45,   C4)
V213 = ( C40,  C45,  -C4)
V214 = (-C40,  C45,   C4)
V215 = (-C40, -C45,  -C4)
V216 = ( C33,  C28,  C44)
V217 = ( C33, -C28, -C44)
V218 = (-C33, -C28,  C44)
V219 = (-C33,  C28, -C44)
V220 = ( C44,  C33,  C28)
V221 = ( C44, -C33, -C28)
V222 = (-C44, -C33,  C28)
V223 = (-C44,  C33, -C28)
V224 = ( C28,  C44,  C33)
V225 = ( C28, -C44, -C33)
V226 = (-C28, -C44,  C33)
V227 = (-C28,  C44, -C33)
V228 = ( C41,  C16,  C43)
V229 = ( C41, -C16, -C43)
V230 = (-C41, -C16,  C43)
V231 = (-C41,  C16, -C43)
V232 = ( C43,  C41,  C16)
V233 = ( C43, -C41, -C16)
V234 = (-C43, -C41,  C16)
V235 = (-C43,  C41, -C16)
V236 = ( C16,  C43,  C41)
V237 = ( C16, -C43, -C41)
V238 = (-C16, -C43,  C41)
V239 = (-C16,  C43, -C41)
V240 = ( C38, -C25,  C42)
V241 = ( C38,  C25, -C42)
V242 = (-C38,  C25,  C42)
V243 = (-C38, -C25, -C42)
V244 = ( C42, -C38,  C25)
V245 = ( C42,  C38, -C25)
V246 = (-C42,  C38,  C25)
V247 = (-C42, -C38, -C25)
V248 = ( C25, -C42,  C38)
V249 = ( C25,  C42, -C38)
V250 = (-C25,  C42,  C38)
V251 = (-C25, -C42, -C38)
V252 = ( C35,  C35,  C35)
V253 = ( C35,  C35, -C35)
V254 = ( C35, -C35,  C35)
V255 = ( C35, -C35, -C35)
V256 = (-C35,  C35,  C35)
V257 = (-C35,  C35, -C35)
V258 = (-C35, -C35,  C35)
V259 = (-C35, -C35, -C35)

Faces:
{  60, 120, 180, 156,  84 }
{  61, 121, 181, 157,  85 }
{  62, 122, 182, 158,  86 }
{  63, 123, 183, 159,  87 }
{  64, 124, 184, 161,  89 }
{  65, 125, 185, 160,  88 }
{  66, 126, 186, 163,  91 }
{  67, 127, 187, 162,  90 }
{  68, 128, 188, 166,  94 }
{  69, 129, 189, 167,  95 }
{  70, 130, 190, 164,  92 }
{  71, 131, 191, 165,  93 }
{  72,  24,   0,  12,  60,  84 }
{  73,  25,   1,  13,  61,  85 }
{  74,  26,   2,  14,  62,  86 }
{  75,  27,   3,  15,  63,  87 }
{  76,  28,   4,  17,  65,  88 }
{  77,  29,   5,  16,  64,  89 }
{  78,  30,   6,  19,  67,  90 }
{  79,  31,   7,  18,  66,  91 }
{  80,  32,   8,  22,  70,  92 }
{  81,  33,   9,  23,  71,  93 }
{  82,  34,  10,  20,  68,  94 }
{  83,  35,  11,  21,  69,  95 }
{  84, 156, 228, 216, 132,  72 }
{  85, 157, 229, 217, 133,  73 }
{  86, 158, 230, 218, 134,  74 }
{  87, 159, 231, 219, 135,  75 }
{  88, 160, 232, 220, 136,  76 }
{  89, 161, 233, 221, 137,  77 }
{  90, 162, 234, 222, 138,  78 }
{  91, 163, 235, 223, 139,  79 }
{  92, 164, 236, 224, 140,  80 }
{  93, 165, 237, 225, 141,  81 }
{  94, 166, 238, 226, 142,  82 }
{  95, 167, 239, 227, 143,  83 }
{  96, 144, 120,  60,  12,  36 }
{  97, 145, 121,  61,  13,  37 }
{  98, 146, 122,  62,  14,  38 }
{  99, 147, 123,  63,  15,  39 }
{ 100, 148, 124,  64,  16,  40 }
{ 101, 149, 125,  65,  17,  41 }
{ 102, 150, 126,  66,  18,  42 }
{ 103, 151, 127,  67,  19,  43 }
{ 104, 152, 128,  68,  20,  44 }
{ 105, 153, 129,  69,  21,  45 }
{ 106, 154, 130,  70,  22,  46 }
{ 107, 155, 131,  71,  23,  47 }
{ 108, 168, 236, 164, 190, 206 }
{ 109, 169, 237, 165, 191, 207 }
{ 110, 170, 238, 166, 188, 204 }
{ 111, 171, 239, 167, 189, 205 }
{ 112, 172, 228, 156, 180, 208 }
{ 113, 173, 229, 157, 181, 209 }
{ 114, 174, 230, 158, 182, 210 }
{ 115, 175, 231, 159, 183, 211 }
{ 116, 176, 232, 160, 185, 213 }
{ 117, 177, 233, 161, 184, 212 }
{ 118, 178, 234, 162, 187, 215 }
{ 119, 179, 235, 163, 186, 214 }
{ 120, 144, 240, 196, 208, 180 }
{ 121, 145, 241, 197, 209, 181 }
{ 122, 146, 242, 198, 210, 182 }
{ 123, 147, 243, 199, 211, 183 }
{ 124, 148, 244, 200, 212, 184 }
{ 125, 149, 245, 201, 213, 185 }
{ 126, 150, 246, 202, 214, 186 }
{ 127, 151, 247, 203, 215, 187 }
{ 128, 152, 248, 192, 204, 188 }
{ 129, 153, 249, 193, 205, 189 }
{ 130, 154, 250, 194, 206, 190 }
{ 131, 155, 251, 195, 207, 191 }
{  48,  24,  72, 132, 168, 108 }
{  48, 108, 206, 194,  98,  38 }
{  48,  38,  14,   2,   0,  24 }
{  49,  27,  75, 135, 171, 111 }
{  49, 111, 205, 193,  97,  37 }
{  49,  37,  13,   1,   3,  27 }
{  50,  26,  74, 134, 170, 110 }
{  50, 110, 204, 192,  96,  36 }
{  50,  36,  12,   0,   2,  26 }
{  51,  25,  73, 133, 169, 109 }
{  51, 109, 207, 195,  99,  39 }
{  51,  39,  15,   3,   1,  25 }
{  52,  28,  76, 136, 172, 112 }
{  52, 112, 208, 196, 100,  40 }
{  52,  40,  16,   5,   4,  28 }
{  53,  29,  77, 137, 173, 113 }
{  53, 113, 209, 197, 101,  41 }
{  53,  41,  17,   4,   5,  29 }
{  54,  30,  78, 138, 174, 114 }
{  54, 114, 210, 198, 102,  42 }
{  54,  42,  18,   7,   6,  30 }
{  55,  31,  79, 139, 175, 115 }
{  55, 115, 211, 199, 103,  43 }
{  55,  43,  19,   6,   7,  31 }
{  56,  32,  80, 140, 176, 116 }
{  56, 116, 213, 201, 105,  45 }
{  56,  45,  21,  11,   8,  32 }
{  57,  33,  81, 141, 177, 117 }
{  57, 117, 212, 200, 104,  44 }
{  57,  44,  20,  10,   9,  33 }
{  58,  35,  83, 143, 179, 119 }
{  58, 119, 214, 202, 106,  46 }
{  58,  46,  22,   8,  11,  35 }
{  59,  34,  82, 142, 178, 118 }
{  59, 118, 215, 203, 107,  47 }
{  59,  47,  23,   9,  10,  34 }
{ 252, 216, 228, 172, 136, 220 }
{ 252, 220, 232, 176, 140, 224 }
{ 252, 224, 236, 168, 132, 216 }
{ 253, 241, 145,  97, 193, 249 }
{ 253, 249, 153, 105, 201, 245 }
{ 253, 245, 149, 101, 197, 241 }
{ 254, 240, 144,  96, 192, 248 }
{ 254, 248, 152, 104, 200, 244 }
{ 254, 244, 148, 100, 196, 240 }
{ 255, 217, 229, 173, 137, 221 }
{ 255, 221, 233, 177, 141, 225 }
{ 255, 225, 237, 169, 133, 217 }
{ 256, 242, 146,  98, 194, 250 }
{ 256, 250, 154, 106, 202, 246 }
{ 256, 246, 150, 102, 198, 242 }
{ 257, 219, 231, 175, 139, 223 }
{ 257, 223, 235, 179, 143, 227 }
{ 257, 227, 239, 171, 135, 219 }
{ 258, 218, 230, 174, 138, 222 }
{ 258, 222, 234, 178, 142, 226 }
{ 258, 226, 238, 170, 134, 218 }
{ 259, 243, 147,  99, 195, 251 }
{ 259, 251, 155, 107, 203, 247 }
{ 259, 247, 151, 103, 199, 243 }
$\endgroup$
  • $\begingroup$ The data is in a file and listed this way? Would be easier to just read the file and build from the data, but need to know the exact format. Maybe post example file? $\endgroup$ – cmomoney Dec 24 '16 at 22:16
  • $\begingroup$ I added the complete file above. $\endgroup$ – quazipseudo Dec 25 '16 at 0:55
2
$\begingroup$

The easy way - enable the Extra mesh objects addon and add a geodisic dome and adjust the operator options - either press F6 or look at the bottom of the toolshelf region.

a geodisic icosahedron

You will also find other objects available like the XYZ Math Surface where you can input the calculations used to create the object.

Another option is sverchok that lets you use nodes to generate a mesh.

As for improving your script, instead of generating the values and adding the results to your script, put the calculations in your script and create the vertices as you calculate each location. As a beginner you may find the geodisic code a bit much as a starting point, so maybe first look at the gemstone code to get an idea of how to do it.

$\endgroup$
  • $\begingroup$ It looks awesome. I'll let you know how it goes. Thanks! $\endgroup$ – quazipseudo Dec 25 '16 at 17:31
  • $\begingroup$ Thank you. This is very useful to know. It does not seem to solve my current problem. I need to make a class three poly dome. This appears to support only class one and two. $\endgroup$ – quazipseudo Dec 28 '16 at 17:56
1
$\begingroup$

you should download and check this course in order to understand how this work, or this one

example new object in add/mesh

actually I did a template that can help you in your work download

the main part is:

edges = []

verts = [(1.0, 0.9999999403953552, -1.0), (1.0, -1.0, -1.0), (-1.0000001192092896, -0.9999998211860657, -1.0), (-0.9999996423721313, 1.0000003576278687, -1.0), (1.0000004768371582, 0.999999463558197, 1.0), (0.9999993443489075, -1.0000005960464478, 1.0), (-1.0000003576278687, -0.9999996423721313, 1.0), (-0.9999999403953552, 1.0, 1.0), (0.9999998807907104, -5.364418029785156e-07, 1.0), (2.384185791015625e-07, 0.9999997615814209, 1.0), (-5.364418029785156e-07, -1.0000001192092896, 1.0), (-1.0000001192092896, 1.7881393432617188e-07, 1.0), (-1.4901161193847656e-07, -1.7881393432617188e-07, 2.5804858207702637)]

faces = [(0, 1, 2, 3), (12, 11, 6, 10), (0, 4, 8, 5, 1), (1, 5, 10, 6, 2), (2, 6, 11, 7, 3), (4, 0, 3, 7, 9), (8, 12, 10, 5), (4, 9, 12, 8), (9, 7, 11, 12)]

You must change the coordinates of the vertices and express the faces that are connected

also you can do the same with or without the edges data.

Here I leave the same template working with your Dual Geodesic Icosahedron Pattern code: test custom object

bl_info = {
    "name": "new objects template",
    "author": "Diego Quevedo",
    "version": (1, 0),
    "blender": (2, 7, 3),
    "location": "View3D > Add > Mesh > New Objetc",
    "description": "template to add new Mesh Object",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Add Mesh"}


import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from mathutils import Vector


def add_object(self, context):
    C0  = 0.0278728483334650370381795124317
    C1  = 0.0417605902707273450330202218460
    C2  = 0.0482207631985655347048259575806
    C3  = 0.0485271500913616902083332985770
    C4  = 0.0931391956773255725056107681612
    C5  = 0.0965573626835274272370348719303
    C6  = 0.107547404625872186617181540007
    C7  = 0.115790817646860551951256687036
    C8  = 0.119783424089466474929919797595048
    C9  = 0.145586591764509108593032943711
    C10 = 0.1455928882670341471433303052049
    C11 = 0.194113741855870798801366242288
    C12 = 0.220431462018603598005258179308
    C13 = 0.238188705049775063930022711304
    C14 = 0.239202575383431558854091591763
    C15 = 0.258249788916612246877163454031
    C16 = 0.267154551763824439262804947967
    C17 = 0.283287921016592357037529251132
    C18 = 0.298950040243594377815031134048
    C19 = 0.324717740377238927017176093829
    C20 = 0.332341771060757131359702359924
    C21 = 0.334746067733302491167057583234
    C22 = 0.358695307225219637200425804924
    C23 = 0.379845283700119784274564123062
    C24 = 0.405175083258563434157399921336
    C25 = 0.405192747827293817829885928720
    C26 = 0.413270268840324805049177290081
    C27 = 0.430496636473677061118504317477
    C28 = 0.435184175960922907431325584883
    C29 = 0.446935673529290779190420143182
    C30 = 0.506357127147255998116896539729
    C31 = 0.524958507348029909087319718931
    C32 = 0.534514094024825642786011006694
    C33 = 0.550779339591802926422918872431
    C34 = 0.569503363526322938881495682523
    C35 = 0.580381198695491106718671839452
    C36 = 0.586729731159675194950822709919
    C37 = 0.592528561796324926333750448387
    C38 = 0.629297917816793706232691827171
    C39 = 0.640749324994890461038576405968
    C40 = 0.645287686083513420132210630583
    C41 = 0.657059511437996058376878453752
    C42 = 0.670748229742154172402305457529
    C43 = 0.711755637544140100272223270381
    C44 = 0.719275379833515862610638756106
    C45 = 0.764606916063868244994059993760
    C46 = 0.765242704206979552285561900711
    C47 = 0.771377873753784688028391160270
    C48 = 0.793115552540444589323741413143
    C49 = 0.801179944373958283220464778439
    C50 = 0.804894833221465672777834038542
    C51 = 0.824918436209450258880845421223
    C52 = 0.8429405346446856282534850002848
    C53 = 0.849729379835397304237950006479
    C54 = 0.8527912845429152959190249336546
    C55 = 0.8911612978432511629583109578654
    C56 = 0.912442237847337859395015578549
    C57 = 0.9169707620208188351717214654752
    C58 = 0.939076505920710743919097644376
    C59 = 0.939706841852119460615896935414
    C60 = 0.969698269985748550217336591577
    C61 = 0.970005426460752347149386724411

    edges = []

    verts = [(C5,C0,1.0),
            (C5,-C0,-1.0),
            (-C5,-C0,1.0),
            (-C5,C0,-1.0),
            (1.0,C5,C0),
            (1.0,-C5,-C0),
            (-1.0,-C5,C0),
            (-1.0,C5,-C0),
            (C0,1.0,C5),
            (C0,-1.0,-C5),
            (-C0,-1.0,C5),
            (-C0,1.0,-C5),
            (C14,-C6,C61),
            (C14,C6,-C61),
            (-C14,C6,C61),
            (-C14,-C6,-C61),
            (C61,-C14,C6),
            (C61,C14,-C6),
            (-C61,C14,C6),
            (-C61,-C14,-C6),
            (C6,-C61,C14),
            (C6,C61,-C14),
            (-C6,C61,C14),
            (-C6,-C61,-C14),
            (C9,C12,C60),
            (C9,-C12,-C60),
            (-C9,-C12,C60),
            (-C9,C12,-C60),
            (C60,C9,C12),
            (C60,-C9,-C12),
            (-C60,-C9,C12),
            (-C60,C9,-C12),
            (C12,C60,C9),
            (C12,-C60,-C9),
            (-C12,-C60,C9),
            (-C12,C60,-C9),
            (C11,-C18,C59),
            (C11,C18,-C59),
            (-C11,C18,C59),
            (-C11,-C18,-C59),
            (C59,-C11,C18),
            (C59,C11,-C18),
            (-C59,C11,C18),
            (-C59,-C11,-C18),
            (C18,-C59,C11),
            (C18,C59,-C11),
            (-C18,C59,C11),
            (-C18,-C59,-C11),
            (0.0,C22,C58),
            (0.0,C22,-C58),
            (0.0,-C22,C58),
            (0.0,-C22,-C58),
            (C58,0.0,C22),
            (C58,0.0,-C22),
            (-C58,0.0,C22),
            (-C58,0.0,-C22),
            (C22,C58,0.0),
            (C22,-C58,0.0),
            (-C22,C58,0.0),
            (-C22,-C58,0.0),
            (C24,-C2,C57),
            (C24,C2,-C57),
            (-C24,C2,C57),
            (-C24,-C2,-C57),
            (C57,-C24,C2),
            (C57,C24,-C2),
            (-C57,C24,C2),
            (-C57,-C24,-C2),
            (C2,-C57,C24),
            (C2,C57,-C24),
            (-C2,C57,C24),
            (-C2,-C57,-C24),
            (C20,C15,C56),
            (C20,-C15,-C56),
            (-C20,-C15,C56),
            (-C20,C15,-C56),
            (C56,C20,C15),
            (C56,-C20,-C15),
            (-C56,-C20,C15),
            (-C56,C20,-C15),
            (C15,C56,C20),
            (C15,-C56,-C20),
            (-C15,-C56,C20),
            (-C15,C56,-C20),
            (C29,C7,C55),
            (C29,-C7,-C55),
            (-C29,-C7,C55),
            (-C29,C7,-C55),
            (C55,C29,C7),
            (C55,-C29,-C7),
            (-C55,-C29,C7),
            (-C55,C29,-C7),
            (C7,C55,C29),
            (C7,-C55,-C29),
            (-C7,-C55,C29),
            (-C7,C55,-C29),
            (C21,-C26,C54),
            (C21,C26,-C54),
            (-C21,C26,C54),
            (-C21,-C26,-C54),
            (C54,-C21,C26),
            (C54,C21,-C26),
            (-C54,C21,C26),
            (-C54,-C21,-C26),
            (C26,-C54,C21),
            (C26,C54,-C21),
            (-C26,C54,C21),
            (-C26,-C54,-C21),
            (C3,C32,C53),
            (C3,-C32,-C53),
            (-C3,-C32,C53),
            (-C3,C32,-C53),
            (C53,C3,C32),
            (C53,-C3,-C32),
            (-C53,-C3,C32),
            (-C53,C3,-C32),
            (C32,C53,C3),
            (C32,-C53,-C3),
            (-C32,-C53,C3),
            (-C32,C53,-C3),
            (C31,-C10,C52),
            (C31,C10,-C52),
            (-C31,C10,C52),
            (-C31,-C10,-C52),
            (C52,-C31,C10),
            (C52,C31,-C10),
            (-C52,C31,C10),
            (-C52,-C31,-C10),
            (C10,-C52,C31),
            (C10,C52,-C31),
            (-C10,C52,C31),
            (-C10,-C52,-C31),
            (C23,C27,C51),
            (C23,-C27,-C51),
            (-C23,-C27,C51),
            (-C23,C27,-C51),
            (C51,C23,C27),
            (C51,-C23,-C27),
            (-C51,-C23,C27),
            (-C51,C23,-C27),
            (C27,C51,C23),
            (C27,-C51,-C23),
            (-C27,-C51,C23),
            (-C27,C51,-C23),
            (C30,-C19,C50),
            (C30,C19,-C50),
            (-C30,C19,C50),
            (-C30,-C19,-C50),
            (C50,-C30,C19),
            (C50,C30,-C19),
            (-C50,C30,C19),
            (-C50,-C30,-C19),
            (C19,-C50,C30),
            (C19,C50,-C30),
            (-C19,C50,C30),
            (-C19,-C50,-C30),
            (C37,C8,C49),
            (C37,-C8,-C49),
            (-C37,-C8,C49),
            (-C37,C8,-C49),
            (C49,C37,C8),
            (C49,-C37,-C8),
            (-C49,-C37,C8),
            (-C49,C37,-C8),
            (C8,C49,C37),
            (C8,-C49,-C37),
            (-C8,-C49,C37),
            (-C8,C49,-C37),
            (C13,C34,C48),
            (C13,-C34,-C48),
            (-C13,-C34,C48),
            (-C13,C34,-C48),
            (C48,C13,C34),
            (C48,-C13,-C34),
            (-C48,-C13,C34),
            (-C48,C13,-C34),
            (C34,C48,C13),
            (C34,-C48,-C13),
            (-C34,-C48,C13),
            (-C34,C48,-C13),
            (C39,-C1,C47),
            (C39,C1,-C47),
            (-C39,C1,C47),
            (-C39,-C1,-C47),
            (C47,-C39,C1),
            (C47,C39,-C1),
            (-C47,C39,C1),
            (-C47,-C39,-C1),
            (C1,-C47,C39),
            (C1,C47,-C39),
            (-C1,C47,C39),
            (-C1,-C47,-C39),
            (C17,-C36,C46),
            (C17,C36,-C46),
            (-C17,C36,C46),
            (-C17,-C36,-C46),
            (C46,-C17,C36),
            (C46,C17,-C36),
            (-C46,C17,C36),
            (-C46,-C17,-C36),
            (C36,-C46,C17),
            (C36,C46,-C17),
            (-C36,C46,C17),
            (-C36,-C46,-C17),
            (C4,-C40,C45),
            (C4,C40,-C45),
            (-C4,C40,C45),
            (-C4,-C40,-C45),
            (C45,-C4,C40),
            (C45,C4,-C40),
            (-C45,C4,C40),
            (-C45,-C4,-C40),
            (C40,-C45,C4),
            (C40,C45,-C4),
            (-C40,C45,C4),
            (-C40,-C45,-C4),
            (C33,C28,C44),
            (C33,-C28,-C44),
            (-C33,-C28,C44),
            (-C33,C28,-C44),
            (C44,C33,C28),
            (C44,-C33,-C28),
            (-C44,-C33,C28),
            (-C44,C33,-C28),
            (C28,C44,C33),
            (C28,-C44,-C33),
            (-C28,-C44,C33),
            (-C28,C44,-C33),
            (C41,C16,C43),
            (C41,-C16,-C43),
            (-C41,-C16,C43),
            (-C41,C16,-C43),
            (C43,C41,C16),
            (C43,-C41,-C16),
            (-C43,-C41,C16),
            (-C43,C41,-C16),
            (C16,C43,C41),
            (C16,-C43,-C41),
            (-C16,-C43,C41),
            (-C16,C43,-C41),
            (C38,-C25,C42),
            (C38,C25,-C42),
            (-C38,C25,C42),
            (-C38,-C25,-C42),
            (C42,-C38,C25),
            (C42,C38,-C25),
            (-C42,C38,C25),
            (-C42,-C38,-C25),
            (C25,-C42,C38),
            (C25,C42,-C38),
            (-C25,C42,C38),
            (-C25,-C42,-C38),
            (C35,C35,C35),
            (C35,C35,-C35),
            (C35,-C35,C35),
            (C35,-C35,-C35),
            (-C35,C35,C35),
            (-C35,C35,-C35),
            (-C35,-C35,C35),
            (-C35,-C35,-C35)]
    faces = [(60, 120, 180, 156,84),
(61, 121, 181, 157,85),
(62, 122, 182, 158,86),
(63, 123, 183, 159,87),
(64, 124, 184, 161,89),
(65, 125, 185, 160,88),
(66, 126, 186, 163,91),
(67, 127, 187, 162,90),
(68, 128, 188, 166,94),
(69, 129, 189, 167,95),
(70, 130, 190, 164,92),
(71, 131, 191, 165,93),
(72,24,0,12,60,84),
(73,25,1,13,61,85),
(74,26,2,14,62,86),
(75,27,3,15,63,87),
(76,28,4,17,65,88),
(77,29,5,16,64,89),
(78,30,6,19,67,90),
(79,31,7,18,66,91),
(80,32,8,22,70,92),
(81,33,9,23,71,93),
(82,34,10,20,68,94),
(83,35,11,21,69,95),
(84, 156, 228, 216, 132,72),
(85, 157, 229, 217, 133,73),
(86, 158, 230, 218, 134,74),
(87, 159, 231, 219, 135,75),
(88, 160, 232, 220, 136,76),
(89, 161, 233, 221, 137,77),
(90, 162, 234, 222, 138,78),
(91, 163, 235, 223, 139,79),
(92, 164, 236, 224, 140,80),
(93, 165, 237, 225, 141,81),
(94, 166, 238, 226, 142,82),
(95, 167, 239, 227, 143,83),
(96, 144, 120,60,12,36),
(97, 145, 121,61,13,37),
(98, 146, 122,62,14,38),
(99, 147, 123,63,15,39),
(100, 148, 124,64,16,40),
(101, 149, 125,65,17,41),
(102, 150, 126,66,18,42),
(103, 151, 127,67,19,43),
(104, 152, 128,68,20,44),
(105, 153, 129,69,21,45),
(106, 154, 130,70,22,46),
(107, 155, 131,71,23,47),
(108, 168, 236, 164, 190, 206),
(109, 169, 237, 165, 191, 207),
(110, 170, 238, 166, 188, 204),
(111, 171, 239, 167, 189, 205),
(112, 172, 228, 156, 180, 208),
(113, 173, 229, 157, 181, 209),
(114, 174, 230, 158, 182, 210),
(115, 175, 231, 159, 183, 211),
(116, 176, 232, 160, 185, 213),
(117, 177, 233, 161, 184, 212),
(118, 178, 234, 162, 187, 215),
(119, 179, 235, 163, 186, 214),
(120, 144, 240, 196, 208, 180),
(121, 145, 241, 197, 209, 181),
(122, 146, 242, 198, 210, 182),
(123, 147, 243, 199, 211, 183),
(124, 148, 244, 200, 212, 184),
(125, 149, 245, 201, 213, 185),
(126, 150, 246, 202, 214, 186),
(127, 151, 247, 203, 215, 187),
(128, 152, 248, 192, 204, 188),
(129, 153, 249, 193, 205, 189),
(130, 154, 250, 194, 206, 190),
(131, 155, 251, 195, 207, 191),
(48,24,72, 132, 168, 108),
(48, 108, 206, 194,98,38),
(48,38,14,2,0,24),
(49,27,75, 135, 171, 111),
(49, 111, 205, 193,97,37),
(49,37,13,1,3,27),
(50,26,74, 134, 170, 110),
(50, 110, 204, 192,96,36),
(50,36,12,0,2,26),
(51,25,73, 133, 169, 109),
(51, 109, 207, 195,99,39),
(51,39,15,3,1,25),
(52,28,76, 136, 172, 112),
(52, 112, 208, 196, 100,40),
(52,40,16,5,4,28),
(53,29,77, 137, 173, 113),
(53, 113, 209, 197, 101,41),
(53,41,17,4,5,29),
(54,30,78, 138, 174, 114),
(54, 114, 210, 198, 102,42),
(54,42,18,7,6,30),
(55,31,79, 139, 175, 115),
(55, 115, 211, 199, 103,43),
(55,43,19,6,7,31),
(56,32,80, 140, 176, 116),
(56, 116, 213, 201, 105,45),
(56,45,21,11,8,32),
(57,33,81, 141, 177, 117),
(57, 117, 212, 200, 104,44),
(57,44,20,10,9,33),
(58,35,83, 143, 179, 119),
(58, 119, 214, 202, 106,46),
(58,46,22,8,11,35),
(59,34,82, 142, 178, 118),
(59, 118, 215, 203, 107,47),
(59,47,23,9,10,34),
(252, 216, 228, 172, 136, 220),
(252, 220, 232, 176, 140, 224),
(252, 224, 236, 168, 132, 216),
(253, 241, 145,97, 193, 249),
(253, 249, 153, 105, 201, 245),
(253, 245, 149, 101, 197, 241),
(254, 240, 144,96, 192, 248),
(254, 248, 152, 104, 200, 244),
(254, 244, 148, 100, 196, 240),
(255, 217, 229, 173, 137, 221),
(255, 221, 233, 177, 141, 225),
(255, 225, 237, 169, 133, 217),
(256, 242, 146,98, 194, 250),
(256, 250, 154, 106, 202, 246),
(256, 246, 150, 102, 198, 242),
(257, 219, 231, 175, 139, 223),
(257, 223, 235, 179, 143, 227),
(257, 227, 239, 171, 135, 219),
(258, 218, 230, 174, 138, 222),
(258, 222, 234, 178, 142, 226),
(258, 226, 238, 170, 134, 218),
(259, 243, 147,99, 195, 251),
(259, 251, 155, 107, 203, 247),
(259, 247, 151, 103, 199, 243)]




    try:

        mesh = bpy.data.meshes.new(name="New Object Mesh")
        mesh.from_pydata(verts, edges, faces)
        # useful for development when the mesh may be invalid.
        # mesh.validate(verbose=True)
        object_data_add(context, mesh, operator=self)
    except:
        print("select one symbol")

class OBJECT_OT_add_object(Operator, AddObjectHelper):
    """Create a new  Mesh Object"""
    bl_idname = "mesh.add_object"
    bl_label = "template Add new mesh Object"
    bl_options = {'REGISTER', 'UNDO'}


    def execute(self, context):

        add_object(self, context)

        return {'FINISHED'}


# Registration

def add_object_button(self, context):
    self.layout.operator(
        OBJECT_OT_add_object.bl_idname,
        text="Add Object",
        icon='PLUGIN')

def menu_draw(self, context):
        self.layout.operator(OBJECT_OT_add_object.bl_idname)





def register():
    bpy.utils.register_module(__name__)
    bpy.types.INFO_MT_mesh_add.prepend(menu_draw)

def unregister():
    bpy.utils.unregister_module(__name__)
    bpy.types.INFO_MT_mesh_custom_add.remove(menu_draw)


if __name__ == "__main__":
    register()
$\endgroup$
  • $\begingroup$ This is very useful. Unfortunately I don't know how to get to the data blocks. I looked at the video you suggested but it starts in the middle of the process, and the console is different. I'm using 2.78. $\endgroup$ – quazipseudo Dec 28 '16 at 17:59
  • $\begingroup$ I have manually, point by point, built part of the object. I want to open the data block, review it, and then copy and paste the remainder of the code, and make a few corrections. $\endgroup$ – quazipseudo Dec 28 '16 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.