storage tank

unfinished version of pipeline
master
Izzy 2019-04-20 18:53:41 -06:00
parent 0cbb808844
commit 9d2581c8ef
5 changed files with 1304 additions and 4 deletions

View File

@ -150,7 +150,7 @@ minetest.register_node("bitumen:kerosene_light_on", {
minetest.register_node("bitumen:magic_light", {
description = "Hidden Magic Light",
drawtype = "node",
drawtype = "airlike",
-- tiles = {"default_mese.png"},
paramtype = "light",
sunlight_propagates = true,

View File

@ -18,9 +18,11 @@ bitumen.magic = {}
minetest.register_node("bitumen:collision_node", {
paramtype = "light",
drawtype = "airlike",
--tiles = {"default_mese.png"},
-- drawtype = "node",
-- tiles = {"default_leaves.png"},
walkable = true,
sunlight_propagates = true,
-- groups = {choppy = 1},
})
@ -42,8 +44,9 @@ bitumen.magic.set_nodes = function(pos, nodename, def)
local p = add(pos, delta)
local n = minetest.get_node(p)
if true or n.name == "air" then
print("magic node at ".. minetest.pos_to_string(p))
local g = minetest.registered_nodes[n.name].groups
if g and not g.bitumen_magic_proof then
-- print("magic node at ".. minetest.pos_to_string(p))
minetest.set_node(p, {name= nodename})
-- minetest.set_node(p, {name= "default:glass"})
@ -92,6 +95,23 @@ bitumen.magic.gensphere = function(center, radius)
return out
end
-- center is the base
bitumen.magic.gencylinder = function(center, radius, height)
local out = {}
for x = -radius, radius do
for z = -radius, radius do
if math.sqrt(x * x + z * z) <= radius then
for y = 0, height do
table.insert(out, {center[1]+x, center[2]+y, center[3]+z})
end
end
end
end
return out
end
bitumen.magic.gencube = function(low, high)
local out = {}

652
models/storage_tank.obj Normal file
View File

@ -0,0 +1,652 @@
# Blender v2.72 (sub 0) OBJ File: 'storage_tank.blend'
# www.blender.org
o Cylinder
v -0.000001 -0.500000 -14.549995
v 2.838563 -0.500000 -14.270421
v 5.568044 -0.500000 -13.442443
v 8.083546 -0.500000 -12.097878
v 10.288404 -0.500000 -10.288400
v 12.097883 -0.500000 -8.083542
v 13.442446 -0.500000 -5.568039
v 14.270425 -0.500000 -2.838560
v 14.549999 -0.500000 0.000003
v 14.270426 -0.500000 2.838567
v 13.442447 -0.500000 5.568047
v 12.097883 -0.500000 8.083550
v 10.288404 -0.500000 10.288408
v 8.083545 -0.500000 12.097889
v 5.568041 -0.500000 13.442453
v 2.838560 -0.500000 14.270432
v -0.000006 -0.500000 14.550005
v -2.838571 -0.500000 14.270430
v -5.568051 -0.500000 13.442449
v -8.083555 -0.500000 12.097883
v -10.288411 -0.500000 10.288403
v -12.097890 -0.500000 8.083543
v -13.442453 -0.500000 5.568038
v -14.270430 -0.500000 2.838556
v -14.550001 -0.500000 -0.000010
v -14.270424 -0.500000 -2.838575
v -13.442443 -0.500000 -5.568054
v -12.097875 -0.500000 -8.083557
v -10.288392 -0.500000 -10.288412
v -8.083532 -0.500000 -12.097890
v -5.568026 -0.500000 -13.442451
v -2.838543 -0.500000 -14.270426
v 0.000000 8.460000 -14.550000
v -0.000001 9.450000 -13.575307
v -0.000000 8.955000 -14.419416
v -0.000000 9.317366 -14.062654
v 2.838564 8.460000 -14.270426
v 2.648411 9.450000 -13.314461
v 2.813088 8.955000 -14.142350
v 2.743487 9.317366 -13.792443
v 5.568045 8.460000 -13.442447
v 5.195045 9.450000 -12.541948
v 5.518072 8.955000 -13.321804
v 5.381545 9.317366 -12.992198
v 8.083547 8.460000 -12.097883
v 7.542039 9.450000 -11.287453
v 8.010998 8.955000 -11.989306
v 7.812794 9.317366 -11.692668
v 10.288404 8.460000 -10.288404
v 9.599192 9.450000 -9.599192
v 10.196068 8.955000 -10.196068
v 9.943797 9.317366 -9.943797
v 12.097884 8.460000 -8.083546
v 11.287457 9.450000 -7.542034
v 11.989308 8.955000 -8.010998
v 11.692672 9.317366 -7.812790
v 13.442447 8.460000 -5.568044
v 12.541947 9.450000 -5.195045
v 13.321803 8.955000 -5.518072
v 12.992197 9.317366 -5.381545
v 14.270426 8.460000 -2.838565
v 13.314461 9.450000 -2.648411
v 14.142350 8.955000 -2.813089
v 13.792443 9.317366 -2.743488
v 14.550000 8.460000 -0.000001
v 13.575307 9.450000 -0.000001
v 14.419416 8.955000 -0.000001
v 14.062654 9.317366 -0.000001
v 14.270427 8.460000 2.838562
v 13.314462 9.450000 2.648409
v 14.142351 8.955000 2.813087
v 13.792444 9.317366 2.743485
v 13.442448 8.460000 5.568042
v 12.541948 9.450000 5.195043
v 13.321804 8.955000 5.518069
v 12.992198 9.317366 5.381542
v 12.097884 8.460000 8.083546
v 11.287455 9.450000 7.542037
v 11.989306 8.955000 8.010998
v 11.692669 9.317366 7.812792
v 10.288404 8.460000 10.288404
v 9.599192 9.450000 9.599192
v 10.196067 8.955000 10.196068
v 9.943797 9.317366 9.943797
v 8.083546 8.460000 12.097884
v 7.542035 9.450000 11.287457
v 8.010997 8.955000 11.989306
v 7.812790 9.317366 11.692670
v 5.568042 8.460000 13.442449
v 5.195045 9.450000 12.541949
v 5.518070 8.955000 13.321805
v 5.381543 9.317366 12.992199
v 2.838561 8.460000 14.270427
v 2.648407 9.450000 13.314462
v 2.813085 8.955000 14.142351
v 2.743484 9.317366 13.792444
v -0.000005 8.460000 14.550000
v -0.000004 9.450000 13.575307
v -0.000005 8.955000 14.419416
v -0.000004 9.317366 14.062654
v -2.838570 8.460000 14.270425
v -2.648420 9.450000 13.314459
v -2.813095 8.955000 14.142348
v -2.743495 9.317366 13.792441
v -5.568051 8.460000 13.442444
v -5.195055 9.450000 12.541944
v -5.518079 8.955000 13.321801
v -5.381553 9.317366 12.992194
v -8.083554 8.460000 12.097878
v -7.542042 9.450000 11.287452
v -8.011005 8.955000 11.989303
v -7.812799 9.317366 11.692665
v -10.288410 8.460000 10.288398
v -9.599197 9.450000 9.599186
v -10.196074 8.955000 10.196060
v -9.943803 9.317366 9.943791
v -12.097889 8.460000 8.083539
v -11.287460 9.450000 7.542029
v -11.989312 8.955000 8.010990
v -11.692674 9.317366 7.812783
v -13.442452 8.460000 5.568033
v -12.541954 9.450000 5.195034
v -13.321810 8.955000 5.518061
v -12.992204 9.317366 5.381533
v -14.270429 8.460000 2.838552
v -13.314464 9.450000 2.648400
v -14.142353 8.955000 2.813076
v -13.792446 9.317366 2.743476
v -14.550000 8.460000 -0.000014
v -13.575307 9.450000 -0.000012
v -14.419416 8.955000 -0.000014
v -14.062654 9.317366 -0.000013
v -14.270423 8.460000 -2.838579
v -13.314458 9.450000 -2.648428
v -14.142348 8.955000 -2.813104
v -13.792440 9.317366 -2.743504
v -13.442442 8.460000 -5.568059
v -12.541944 9.450000 -5.195057
v -13.321798 8.955000 -5.518086
v -12.992192 9.317366 -5.381558
v -12.097874 8.460000 -8.083562
v -11.287445 9.450000 -7.542052
v -11.989297 8.955000 -8.011013
v -11.692658 9.317366 -7.812807
v -10.288391 8.460000 -10.288417
v -9.599180 9.450000 -9.599202
v -10.196054 8.955000 -10.196081
v -9.943786 9.317366 -9.943810
v -8.083531 8.460000 -12.097894
v -7.542021 9.450000 -11.287466
v -8.010983 8.955000 -11.989318
v -7.812777 9.317366 -11.692681
v -5.568025 8.460000 -13.442456
v -5.195026 9.450000 -12.541956
v -5.518052 8.955000 -13.321812
v -5.381526 9.317366 -12.992207
v -2.838542 8.460000 -14.270431
v -2.648392 9.450000 -13.314466
v -2.813067 8.955000 -14.142355
v -2.743467 9.317366 -13.792448
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.500000 1.000000
vt 1.000000 0.500000
vt 0.500000 0.000000
vt 0.961940 0.691342
vt 0.308659 0.961940
vt 0.402456 0.990393
vt 0.084266 0.777786
vt 0.222215 0.915735
vt 0.009607 0.402455
vt 0.000000 0.500000
vt 0.009607 0.597546
vt 0.038060 0.691342
vt 0.038060 0.308659
vt 0.084265 0.222215
vt 0.308658 0.038060
vt 0.222215 0.084265
vt 0.146446 0.146447
vt 0.402455 0.009607
vt 0.853553 0.146447
vt 0.597545 0.009607
vt 0.691342 0.038060
vt 0.777785 0.084265
vt 0.961940 0.308658
vt 0.915735 0.222215
vt 0.990393 0.402455
vt 0.915735 0.777785
vt 0.990393 0.597545
vt 0.146447 0.853554
vt 0.691342 0.961940
vt 0.777785 0.915735
vt 0.597545 0.990393
vt 0.853553 0.853553
vn -0.098000 -0.000000 -0.995200
vn 0.471400 -0.000000 -0.881900
vn 0.634400 -0.000000 -0.773000
vn 0.773000 -0.000000 -0.634400
vn 0.881900 -0.000000 -0.471400
vn 0.956900 -0.000000 -0.290300
vn 0.995200 -0.000000 -0.098000
vn 0.995200 -0.000000 0.098000
vn 0.956900 -0.000000 0.290300
vn 0.881900 0.000000 0.471400
vn 0.773000 0.000000 0.634400
vn 0.634400 0.000000 0.773000
vn 0.471400 0.000000 0.881900
vn 0.290300 0.000000 0.956900
vn 0.098000 0.000000 0.995200
vn -0.098000 0.000000 0.995200
vn -0.290300 0.000000 0.956900
vn -0.471400 0.000000 0.881900
vn -0.634400 0.000000 0.773000
vn -0.773000 0.000000 0.634400
vn -0.881900 0.000000 0.471400
vn -0.956900 0.000000 0.290300
vn -0.995200 0.000000 0.098000
vn -0.995200 0.000000 -0.098000
vn -0.956900 -0.000000 -0.290300
vn -0.881900 -0.000000 -0.471400
vn -0.773000 -0.000000 -0.634400
vn -0.634400 -0.000000 -0.773000
vn -0.471400 -0.000000 -0.881900
vn -0.290300 -0.000000 -0.956900
vn 0.290300 -0.000000 -0.956900
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.094800 0.253900 -0.962600
vn 0.070000 0.699900 -0.710800
vn 0.025900 0.964600 -0.262500
vn 0.280800 0.253900 -0.925600
vn 0.207300 0.699900 -0.683500
vn 0.076600 0.964600 -0.252400
vn 0.455900 0.253900 -0.853000
vn 0.336700 0.699900 -0.629900
vn 0.124300 0.964600 -0.232600
vn 0.613600 0.253900 -0.747700
vn 0.453100 0.699900 -0.552200
vn 0.167300 0.964600 -0.203900
vn 0.747700 0.253900 -0.613600
vn 0.552100 0.699900 -0.453100
vn 0.203900 0.964600 -0.167300
vn 0.853000 0.253900 -0.455900
vn 0.629900 0.699900 -0.336700
vn 0.232600 0.964600 -0.124300
vn 0.925600 0.253900 -0.280800
vn 0.683500 0.699900 -0.207300
vn 0.252400 0.964600 -0.076600
vn 0.962600 0.253900 -0.094800
vn 0.710800 0.699900 -0.070000
vn 0.262500 0.964600 -0.025900
vn 0.962600 0.253900 0.094800
vn 0.710800 0.699900 0.070000
vn 0.262500 0.964600 0.025900
vn 0.925600 0.253900 0.280800
vn 0.683500 0.699900 0.207300
vn 0.252400 0.964600 0.076600
vn 0.853000 0.253900 0.455900
vn 0.629900 0.699900 0.336700
vn 0.232600 0.964600 0.124300
vn 0.747700 0.253900 0.613600
vn 0.552200 0.699900 0.453100
vn 0.203900 0.964600 0.167300
vn 0.613600 0.253900 0.747700
vn 0.453100 0.699900 0.552100
vn 0.167300 0.964600 0.203900
vn 0.455900 0.253900 0.853000
vn 0.336700 0.699900 0.629900
vn 0.124300 0.964600 0.232600
vn 0.280800 0.253900 0.925600
vn 0.207300 0.699900 0.683500
vn 0.076600 0.964600 0.252400
vn 0.094800 0.253900 0.962600
vn 0.070000 0.699900 0.710800
vn 0.025900 0.964600 0.262500
vn -0.094800 0.253900 0.962600
vn -0.070000 0.699900 0.710800
vn -0.025900 0.964600 0.262500
vn -0.280800 0.253900 0.925600
vn -0.207300 0.699900 0.683500
vn -0.076600 0.964600 0.252400
vn -0.455900 0.253900 0.853000
vn -0.336700 0.699900 0.629900
vn -0.124300 0.964600 0.232600
vn -0.613600 0.253900 0.747700
vn -0.453100 0.699900 0.552100
vn -0.167300 0.964600 0.203900
vn -0.747700 0.253900 0.613600
vn -0.552100 0.699900 0.453100
vn -0.203900 0.964600 0.167300
vn -0.853000 0.253900 0.455900
vn -0.629900 0.699900 0.336700
vn -0.232600 0.964600 0.124300
vn -0.925600 0.253900 0.280800
vn -0.683500 0.699900 0.207300
vn -0.252400 0.964600 0.076600
vn -0.962600 0.253900 0.094800
vn -0.710800 0.699900 0.070000
vn -0.262500 0.964600 0.025900
vn -0.962600 0.253900 -0.094800
vn -0.710800 0.699900 -0.070000
vn -0.262500 0.964600 -0.025900
vn -0.925600 0.253900 -0.280800
vn -0.683500 0.699900 -0.207300
vn -0.252400 0.964600 -0.076600
vn -0.853000 0.253900 -0.455900
vn -0.629900 0.699900 -0.336700
vn -0.232600 0.964600 -0.124300
vn -0.747700 0.253900 -0.613600
vn -0.552100 0.699900 -0.453100
vn -0.203900 0.964600 -0.167300
vn -0.613600 0.253900 -0.747700
vn -0.453100 0.699900 -0.552100
vn -0.167300 0.964600 -0.203900
vn -0.455900 0.253900 -0.853000
vn -0.336700 0.699900 -0.629900
vn -0.124300 0.964600 -0.232600
vn -0.280800 0.253900 -0.925600
vn -0.207300 0.699900 -0.683500
vn -0.076600 0.964600 -0.252400
vn -0.094800 0.253900 -0.962600
vn -0.070000 0.699900 -0.710800
vn -0.025900 0.964600 -0.262500
vn 0.098000 -0.000000 -0.995200
vn 0.453100 0.699900 -0.552100
vn 0.552200 0.699900 -0.453100
vn 0.552100 0.699900 0.453100
vn 0.453100 0.699900 0.552200
vn -0.552200 0.699900 0.453100
vn -0.453100 0.699900 -0.552200
s off
f 157/1/1 33/2/1 1/3/1
f 3/4/2 41/1/2 45/2/2
f 45/1/3 49/2/3 5/3/3
f 49/1/4 53/2/4 6/3/4
f 53/1/5 57/2/5 7/3/5
f 57/1/6 61/2/6 8/3/6
f 61/1/7 65/2/7 9/3/7
f 65/1/8 69/2/8 10/3/8
f 69/1/9 73/2/9 11/3/9
f 73/1/10 77/2/10 12/3/10
f 77/1/11 81/2/11 13/3/11
f 81/1/12 85/2/12 14/3/12
f 85/1/13 89/2/13 15/3/13
f 89/1/14 93/2/14 16/3/14
f 93/1/15 97/2/15 17/3/15
f 97/1/16 101/2/16 18/3/16
f 18/4/17 101/1/17 105/2/17
f 105/1/18 109/2/18 20/3/18
f 109/1/19 113/2/19 21/3/19
f 21/4/20 113/1/20 117/2/20
f 117/1/21 121/2/21 23/3/21
f 23/4/22 121/1/22 125/2/22
f 24/4/23 125/1/23 129/2/23
f 25/4/24 129/1/24 133/2/24
f 26/4/25 133/1/25 137/2/25
f 27/4/26 137/1/26 141/2/26
f 28/4/27 141/1/27 145/2/27
f 145/1/28 149/2/28 30/3/28
f 30/4/29 149/1/29 153/2/29
f 31/4/30 153/1/30 157/2/30
f 37/1/31 41/2/31 3/3/31
f 38/5/32 134/6/32 102/7/32
f 1/5/33 7/8/33 17/7/33
f 33/1/34 35/2/34 39/3/34
f 35/1/35 36/2/35 40/3/35
f 40/4/36 36/1/36 34/2/36
f 41/4/37 37/1/37 39/2/37
f 39/1/38 40/2/38 44/3/38
f 44/4/39 40/1/39 38/2/39
f 41/1/40 43/2/40 47/3/40
f 43/1/41 44/2/41 48/3/41
f 44/1/42 42/2/42 46/3/42
f 49/4/43 45/1/43 47/2/43
f 47/1/44 48/2/44 52/3/44
f 48/1/45 46/2/45 50/3/45
f 53/4/46 49/1/46 51/2/46
f 51/1/47 52/2/47 56/3/47
f 52/1/48 50/2/48 54/3/48
f 53/1/49 55/2/49 59/3/49
f 55/1/50 56/2/50 60/3/50
f 56/1/51 54/2/51 58/3/51
f 57/1/52 59/2/52 63/3/52
f 63/4/53 59/1/53 60/2/53
f 60/1/54 58/2/54 62/3/54
f 61/1/55 63/2/55 67/3/55
f 63/1/56 64/2/56 68/3/56
f 64/1/57 62/2/57 66/3/57
f 65/1/58 67/2/58 71/3/58
f 71/4/59 67/1/59 68/2/59
f 68/1/60 66/2/60 70/3/60
f 69/1/61 71/2/61 75/3/61
f 71/1/62 72/2/62 76/3/62
f 72/1/63 70/2/63 74/3/63
f 73/1/64 75/2/64 79/3/64
f 75/1/65 76/2/65 80/3/65
f 76/1/66 74/2/66 78/3/66
f 77/1/67 79/2/67 83/3/67
f 83/4/68 79/1/68 80/2/68
f 80/1/69 78/2/69 82/3/69
f 81/1/70 83/2/70 87/3/70
f 87/4/71 83/1/71 84/2/71
f 88/4/72 84/1/72 82/2/72
f 85/1/73 87/2/73 91/3/73
f 91/4/74 87/1/74 88/2/74
f 92/4/75 88/1/75 86/2/75
f 89/1/76 91/2/76 95/3/76
f 95/4/77 91/1/77 92/2/77
f 96/4/78 92/1/78 90/2/78
f 93/1/79 95/2/79 99/3/79
f 99/4/80 95/1/80 96/2/80
f 96/1/81 94/2/81 98/3/81
f 97/1/82 99/2/82 103/3/82
f 99/1/83 100/2/83 104/3/83
f 100/1/84 98/2/84 102/3/84
f 101/1/85 103/2/85 107/3/85
f 103/1/86 104/2/86 108/3/86
f 104/1/87 102/2/87 106/3/87
f 105/1/88 107/2/88 111/3/88
f 107/1/89 108/2/89 112/3/89
f 108/1/90 106/2/90 110/3/90
f 109/1/91 111/2/91 115/3/91
f 115/4/92 111/1/92 112/2/92
f 116/4/93 112/1/93 110/2/93
f 113/1/94 115/2/94 119/3/94
f 119/4/95 115/1/95 116/2/95
f 116/1/96 114/2/96 118/3/96
f 117/1/97 119/2/97 123/3/97
f 123/4/98 119/1/98 120/2/98
f 120/1/99 118/2/99 122/3/99
f 121/1/100 123/2/100 127/3/100
f 123/1/101 124/2/101 128/3/101
f 124/1/102 122/2/102 126/3/102
f 125/1/103 127/2/103 131/3/103
f 131/4/104 127/1/104 128/2/104
f 132/4/105 128/1/105 126/2/105
f 129/1/106 131/2/106 135/3/106
f 131/1/107 132/2/107 136/3/107
f 132/1/108 130/2/108 134/3/108
f 137/4/109 133/1/109 135/2/109
f 135/1/110 136/2/110 140/3/110
f 140/4/111 136/1/111 134/2/111
f 141/4/112 137/1/112 139/2/112
f 139/1/113 140/2/113 144/3/113
f 140/1/114 138/2/114 142/3/114
f 141/1/115 143/2/115 147/3/115
f 143/1/116 144/2/116 148/3/116
f 148/4/117 144/1/117 142/2/117
f 145/1/118 147/2/118 151/3/118
f 151/4/119 147/1/119 148/2/119
f 152/4/120 148/1/120 146/2/120
f 153/4/121 149/1/121 151/2/121
f 151/1/122 152/2/122 156/3/122
f 152/1/123 150/2/123 154/3/123
f 157/4/124 153/1/124 155/2/124
f 155/1/125 156/2/125 160/3/125
f 156/1/126 154/2/126 158/3/126
f 33/4/127 157/1/127 159/2/127
f 35/4/128 159/1/128 160/2/128
f 36/4/129 160/1/129 158/2/129
f 33/1/130 37/2/130 2/3/130
f 32/4/1 157/1/1 1/3/1
f 4/3/2 3/4/2 45/2/2
f 4/4/3 45/1/3 5/3/3
f 5/4/4 49/1/4 6/3/4
f 6/4/5 53/1/5 7/3/5
f 7/4/6 57/1/6 8/3/6
f 8/4/7 61/1/7 9/3/7
f 9/4/8 65/1/8 10/3/8
f 10/4/9 69/1/9 11/3/9
f 11/4/10 73/1/10 12/3/10
f 12/4/11 77/1/11 13/3/11
f 13/4/12 81/1/12 14/3/12
f 14/4/13 85/1/13 15/3/13
f 15/4/14 89/1/14 16/3/14
f 16/4/15 93/1/15 17/3/15
f 17/4/16 97/1/16 18/3/16
f 19/3/17 18/4/17 105/2/17
f 19/4/18 105/1/18 20/3/18
f 20/4/19 109/1/19 21/3/19
f 22/3/20 21/4/20 117/2/20
f 22/4/21 117/1/21 23/3/21
f 24/3/22 23/4/22 125/2/22
f 25/3/23 24/4/23 129/2/23
f 26/3/24 25/4/24 133/2/24
f 27/3/25 26/4/25 137/2/25
f 28/3/26 27/4/26 141/2/26
f 29/3/27 28/4/27 145/2/27
f 29/4/28 145/1/28 30/3/28
f 31/3/29 30/4/29 153/2/29
f 32/3/30 31/4/30 157/2/30
f 2/4/31 37/1/31 3/3/31
f 46/9/32 42/10/32 38/5/32
f 46/9/32 58/11/32 50/12/32
f 74/13/32 70/14/32 66/15/32
f 62/16/32 74/13/32 66/15/32
f 62/16/32 58/11/32 102/7/32
f 78/17/32 74/13/32 82/18/32
f 94/19/32 90/20/32 86/21/32
f 102/7/32 98/22/32 94/19/32
f 102/7/32 118/23/32 106/24/32
f 110/25/32 106/24/32 114/26/32
f 126/27/32 122/28/32 118/23/32
f 126/27/32 118/23/32 130/29/32
f 134/6/32 146/30/32 138/31/32
f 106/24/32 118/23/32 114/26/32
f 58/11/32 54/32/32 50/12/32
f 158/33/32 154/34/32 34/35/32
f 38/5/32 58/11/32 46/9/32
f 29/32/33 30/12/33 31/9/33
f 74/13/32 62/16/32 102/7/32
f 102/7/32 94/19/32 86/21/32
f 118/23/32 134/6/32 130/29/32
f 74/13/32 86/21/32 82/18/32
f 146/30/32 134/6/32 38/5/32
f 154/34/32 150/36/32 146/30/32
f 58/11/32 38/5/32 102/7/32
f 154/34/32 38/5/32 34/35/32
f 134/6/32 118/23/32 102/7/32
f 38/5/32 154/34/32 146/30/32
f 74/13/32 102/7/32 86/21/32
f 1/5/33 29/32/33 32/10/33
f 146/30/32 142/8/32 138/31/32
f 29/32/33 26/15/33 28/11/33
f 22/18/33 23/17/33 24/13/33
f 25/14/33 22/18/33 24/13/33
f 14/26/33 16/24/33 13/23/33
f 19/19/33 20/20/33 21/21/33
f 17/7/33 18/22/33 19/19/33
f 14/26/33 15/25/33 16/24/33
f 16/24/33 11/27/33 13/23/33
f 11/27/33 12/28/33 13/23/33
f 9/6/33 10/29/33 11/27/33
f 7/8/33 8/31/33 9/6/33
f 5/36/33 6/30/33 7/8/33
f 5/36/33 7/8/33 4/34/33
f 1/5/33 2/35/33 3/33/33
f 26/15/33 27/16/33 28/11/33
f 39/4/35 35/1/35 40/3/35
f 29/32/33 25/14/33 26/15/33
f 25/14/33 29/32/33 21/21/33
f 16/24/33 17/7/33 11/27/33
f 29/32/33 31/9/33 32/10/33
f 7/8/33 9/6/33 17/7/33
f 7/8/33 3/33/33 4/34/33
f 1/5/33 19/19/33 29/32/33
f 29/32/33 19/19/33 21/21/33
f 25/14/33 21/21/33 22/18/33
f 17/7/33 9/6/33 11/27/33
f 17/7/33 19/19/33 1/5/33
f 37/4/34 33/1/34 39/3/34
f 3/33/33 7/8/33 1/5/33
f 38/3/36 40/4/36 34/2/36
f 43/3/37 41/4/37 39/2/37
f 43/4/38 39/1/38 44/3/38
f 42/3/39 44/4/39 38/2/39
f 45/4/40 41/1/40 47/3/40
f 47/4/41 43/1/41 48/3/41
f 48/4/42 44/1/42 46/3/42
f 51/3/43 49/4/43 47/2/43
f 51/4/131 47/1/131 52/3/131
f 52/4/45 48/1/45 50/3/45
f 55/3/46 53/4/46 51/2/46
f 55/4/132 51/1/132 56/3/132
f 56/4/48 52/1/48 54/3/48
f 57/4/49 53/1/49 59/3/49
f 59/4/50 55/1/50 60/3/50
f 60/4/51 56/1/51 58/3/51
f 61/4/52 57/1/52 63/3/52
f 64/3/53 63/4/53 60/2/53
f 64/4/54 60/1/54 62/3/54
f 65/4/55 61/1/55 67/3/55
f 67/4/56 63/1/56 68/3/56
f 68/4/57 64/1/57 66/3/57
f 69/4/58 65/1/58 71/3/58
f 72/3/59 71/4/59 68/2/59
f 72/4/60 68/1/60 70/3/60
f 73/4/61 69/1/61 75/3/61
f 75/4/62 71/1/62 76/3/62
f 76/4/63 72/1/63 74/3/63
f 77/4/64 73/1/64 79/3/64
f 79/4/65 75/1/65 80/3/65
f 80/4/66 76/1/66 78/3/66
f 81/4/67 77/1/67 83/3/67
f 84/3/133 83/4/133 80/2/133
f 84/4/69 80/1/69 82/3/69
f 85/4/70 81/1/70 87/3/70
f 88/3/134 87/4/134 84/2/134
f 86/3/72 88/4/72 82/2/72
f 89/4/73 85/1/73 91/3/73
f 92/3/74 91/4/74 88/2/74
f 90/3/75 92/4/75 86/2/75
f 93/4/76 89/1/76 95/3/76
f 96/3/77 95/4/77 92/2/77
f 94/3/78 96/4/78 90/2/78
f 97/4/79 93/1/79 99/3/79
f 100/3/80 99/4/80 96/2/80
f 100/4/81 96/1/81 98/3/81
f 101/4/82 97/1/82 103/3/82
f 103/4/83 99/1/83 104/3/83
f 104/4/84 100/1/84 102/3/84
f 105/4/85 101/1/85 107/3/85
f 107/4/86 103/1/86 108/3/86
f 108/4/87 104/1/87 106/3/87
f 109/4/88 105/1/88 111/3/88
f 111/4/89 107/1/89 112/3/89
f 112/4/90 108/1/90 110/3/90
f 113/4/91 109/1/91 115/3/91
f 116/3/92 115/4/92 112/2/92
f 114/3/93 116/4/93 110/2/93
f 117/4/94 113/1/94 119/3/94
f 120/3/135 119/4/135 116/2/135
f 120/4/96 116/1/96 118/3/96
f 121/4/97 117/1/97 123/3/97
f 124/3/98 123/4/98 120/2/98
f 124/4/99 120/1/99 122/3/99
f 125/4/100 121/1/100 127/3/100
f 127/4/101 123/1/101 128/3/101
f 128/4/102 124/1/102 126/3/102
f 129/4/103 125/1/103 131/3/103
f 132/3/104 131/4/104 128/2/104
f 130/3/105 132/4/105 126/2/105
f 133/4/106 129/1/106 135/3/106
f 135/4/107 131/1/107 136/3/107
f 136/4/108 132/1/108 134/3/108
f 139/3/109 137/4/109 135/2/109
f 139/4/110 135/1/110 140/3/110
f 138/3/111 140/4/111 134/2/111
f 143/3/112 141/4/112 139/2/112
f 143/4/113 139/1/113 144/3/113
f 144/4/114 140/1/114 142/3/114
f 145/4/115 141/1/115 147/3/115
f 147/4/116 143/1/116 148/3/116
f 146/3/117 148/4/117 142/2/117
f 149/4/118 145/1/118 151/3/118
f 152/3/136 151/4/136 148/2/136
f 150/3/120 152/4/120 146/2/120
f 155/3/121 153/4/121 151/2/121
f 155/4/122 151/1/122 156/3/122
f 156/4/123 152/1/123 154/3/123
f 159/3/124 157/4/124 155/2/124
f 159/4/125 155/1/125 160/3/125
f 160/4/126 156/1/126 158/3/126
f 35/3/127 33/4/127 159/2/127
f 36/3/128 35/4/128 160/2/128
f 34/3/129 36/4/129 158/2/129
f 1/4/130 33/1/130 2/3/130

627
pipeline.lua Normal file
View File

@ -0,0 +1,627 @@
-- pipelines are like pipes except much larger and more performant
-- pipelines are also only point-to-point; there are no joints
-- pipelines need pumps to force the fluid through, even downhill
local networks = {}
local net_members = {}
local netname = 1
local mod_storage = minetest.get_mod_storage()
networks = minetest.deserialize(mod_storage:get_string("pl_networks")) or {}
net_members = minetest.deserialize(mod_storage:get_string("pl_net_members")) or {}
netname = mod_storage:get_int("pl_netname") or 1
local function save_data()
--print("saving")
mod_storage:set_string("pl_networks", minetest.serialize(networks))
mod_storage:set_string("pl_net_members", minetest.serialize(net_members))
mod_storage:set_int("pl_netname", netname)
end
-- centralized network creation for consistency
local function new_network(pos)
local hash = minetest.hash_node_position(pos)
print("new pipeline network: hash: ".. hash .." name: " ..netname);
networks[hash] = {
hash = hash,
pos = {x=pos.x, y=pos.y, z=pos.z},
fluid = 'air',
name = netname,
count = 1,
inputs = {
[hash] = 1,
},
outputs = {},
buffer = 0,
in_pressure = -32000,
}
net_members[hash] = hash
netname = netname + 1
return networks[hash], hash
end
local function pnet_for(pos)
local hash = minetest.hash_node_position(pos)
local ph = net_members[hash]
if ph == nil then
return nil, hash
end
return networks[ph], hash
end
-- merge a list of networks, if the are multiple nets in the list
local function try_merge(merge_list)
if #merge_list > 1 then
print("\n merging "..#merge_list.." networks")
local biggest = {count = 0}
local mlookup = {}
for _,n in ipairs(merge_list) do
mlookup[n.hash] = 1
if n.count > biggest.count then
biggest = n
end
end
mlookup[biggest.hash] = 0
for k,v in pairs(net_members) do
if mlookup[v] == 1 then
net_members[k] = biggest.hash
end
end
for _,n in ipairs(merge_list) do
if n.hash ~= biggest.hash then
biggest.count = biggest.count + n.count
networks[n.hash] = nil -- delete old networks
end
end
return biggest
end
return merge_list[1]
end
-- check specific nearby nodes for existing networks
local function check_merge(pos, npos1, npos2)
local hash = minetest.hash_node_position(pos)
local merge_list = {}
local current_net = nil
local found_net = 0
local check_net = function(npos)
local nhash = minetest.hash_node_position(npos)
local nphash = net_members[nhash]
if nphash ~= nil then
local pnet = networks[nphash]
if nil == current_net then
print("joining existing network: ".. pnet.name)
net_members[hash] = nphash
current_net = nphash
pnet.count = pnet.count + 1
pnet.inputs[hash] = 1
table.insert(merge_list, pnet)
elseif current_net == nphash then
print("alternate connection to existing network")
else
print("found seconday network: "..pnet.name)
table.insert(merge_list, pnet)
end
found_net = 1
end
end
check_net(npos1)
check_net(npos2)
return found_net, merge_list
end
bitumen.pipelines = {}
-- used by external machines to find the network for a node
bitumen.pipelines.get_net = function(pos)
local hash = minetest.hash_node_position(pos)
local phash = net_members[hash]
if phash == nil then
return nil, nil, hash
end
return networks[phash], phash, hash
end
bitumen.pipes.after_change = function(pos, opos1, opos2, npos1, npos2)
local o1net, o1phash, o1hash = bitumen.pipelines.get_net(opos1)
local o2net, o2phash, o2hash = bitumen.pipelines.get_net(opos2)
local n1net, n1phash, n1hash = bitumen.pipelines.get_net(npos1)
local n2net, n2phash, n2hash = bitumen.pipelines.get_net(npos2)
local check_o1 = true
local check_o2 = true
local check_n1 = true
local check_n2 = true
-- check if one of the nodes is still in the network. this will often be the case
if vector.equals(opos1, npos1) then
print("old pos 1 is new pos 1")
check_o1 = false
check_n1 = false
elseif vector.equals(opos1, npos2) then
print("old pos 1 is new pos 1")
check_o1 = false
check_n2 = false
end
if vector.equals(opos2, npos1) then
print("old pos 1 is new pos 1")
check_o2 = false
check_n1 = false
elseif vector.equals(opos2, npos2) then
print("old pos 1 is new pos 1")
check_o2 = false
check_n2 = false
end
-- remove o1 from the network
if check_o1 then
end
-- merge with n1's network
if check_o1 then
end
local hash = minetest.hash_node_position(pos)
local phash = net_members[hash]
if phash == nil then
print("wtf: pipe has no network in after_destruct")
return
end
local pnet = networks[phash]
if pnet == nil then
print("wtf: no network in after_destruct for pipe")
return
end
-- remove this node from the network
net_members[hash] = nil
pnet.count = pnet.count - 1
-- neighboring nodes
local check_pos = {
{x=pos.x+1, y=pos.y, z=pos.z},
{x=pos.x-1, y=pos.y, z=pos.z},
{x=pos.x, y=pos.y+1, z=pos.z},
{x=pos.x, y=pos.y-1, z=pos.z},
{x=pos.x, y=pos.y, z=pos.z+1},
{x=pos.x, y=pos.y, z=pos.z-1},
}
local stack = {}
local found = 0
-- check neighbors for network membership
for _,p in ipairs(check_pos) do
local h = minetest.hash_node_position(p)
local lphash = net_members[h]
if lphash ~= nil then
local lpnet = networks[lphash]
-- only process pipes/fixtures on the same network as the destroyed pipe
if lpnet and lpnet.name == pnet.name then
stack[h] = vector.new(p)
found = found + 1
--print("check stack: "..p.x..","..p.y..","..p.z)
else
print("no lpnet")
end
else
print("no lphash "..p.x..","..p.y..","..p.z)
end
end
-- don't need to split the network if this was just on the end
if found > 1 then
--print("check to split the network")
for h,p in pairs(stack) do
print(dump(p))
print(dump(h))
-- BUG: spouts and intakes can be counted as pipes when walking the network
-- just rename the net
local new_pnet = rebase_network(p)
-- print("split off pnet ".. new_pnet.name .. " at " .. minetest.pos_to_string(p))
-- all fluid is lost in the network atm
-- some networks might get orphaned, for example, the first
-- net to be rebased in a loop
end
end
save_data()
end
minetest.register_node("bitumen:pipeline", {
description = "Petroleum pipeline segment",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-.3, -.35, -.5, .3, .35, .5},
{-.35, -.3, -.5, .35, .3, .5},
-- {-.4, -.4, -.4, .4, .4, .4},
-- {-.4, -.4, -.4, .4, .4, .4},
},
},
paramtype = "light",
is_ground_content = false,
paramtype2 = "facedir",
is_ground_content = false,
tiles = { "default_gold_block.png" },
walkable = true,
groups = { cracky = 3, petroleum_pipeline = 1, },
on_place = minetest.rotate_node,
on_construct = function(pos)
print("\npipeline placed at "..pos.x..","..pos.y..","..pos.z)
local node = minetest.get_node(pos)
local back_dir = minetest.facedir_to_dir(node.param2)
local backpos = vector.add(pos, back_dir)
local frontpos = vector.subtract(pos, back_dir)
-- minetest.set_node(backpos, {name="default:dirt"})
-- local found_net, merge_list = check_merge(pos)
--if found_net == 0 then
-- local net = new_network(pos)
--end
-- try_merge(merge_list)
--save_data()
end,
--after_destruct = bitumen.pipes.after_destruct,
})
minetest.register_node("bitumen:pipeline_elbow", {
description = "Petroleum pipeline elbow",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-.3, -.35, -.5, .3, .35, .3},
{-.35, -.3, -.5, .35, .3, .3},
{-.3, -.3, -.35, .3, .5, .35},
{-.35, -.3, -.3, .35, .5, .3},
-- {-.4, -.4, -.4, .4, .4, .4},
-- {-.4, -.4, -.4, .4, .4, .4},
},
},
paramtype = "light",
is_ground_content = false,
paramtype2 = "facedir",
is_ground_content = false,
tiles = { "default_gold_block.png" },
walkable = true,
groups = { cracky = 3, petroleum_pipeline = 1, },
on_place = minetest.rotate_node,
on_rotate = function(pos, node, player, mode, new_param2)
local oldback_dir = minetest.facedir_to_dir(node.param2)
local oldfrontpos = vector.subtract(pos, oldback_dir)
local oldtop_dir = ({[0]={x=0, y=1, z=0},
{x=0, y=0, z=1},
{x=0, y=0, z=-1},
{x=1, y=0, z=0},
{x=-1, y=0, z=0},
{x=0, y=-1, z=0}})[math.floor(node.param2/4)]
local oldtoppos = vector.add(pos, oldtop_dir)
minetest.set_node(oldfrontpos, {name="default:glass"})
minetest.set_node(oldtoppos, {name="default:glass"})
local back_dir = minetest.facedir_to_dir(new_param2)
local frontpos = vector.subtract(pos, back_dir)
local top_dir = ({[0]={x=0, y=1, z=0},
{x=0, y=0, z=1},
{x=0, y=0, z=-1},
{x=1, y=0, z=0},
{x=-1, y=0, z=0},
{x=0, y=-1, z=0}})[math.floor(new_param2/4)]
local toppos = vector.add(pos, top_dir)
minetest.set_node(frontpos, {name="default:dirt"})
minetest.set_node(toppos, {name="default:cobble"})
end,
on_construct = function(pos)
print("\npipeline elbow placed at "..pos.x..","..pos.y..","..pos.z)
local node = minetest.get_node(pos)
local back_dir = minetest.facedir_to_dir(node.param2)
local frontpos = vector.subtract(pos, back_dir)
local top_dir = ({[0]={x=0, y=1, z=0},
{x=0, y=0, z=1},
{x=0, y=0, z=-1},
{x=1, y=0, z=0},
{x=-1, y=0, z=0},
{x=0, y=-1, z=0}})[math.floor(node.param2/4)]
local toppos = vector.add(pos, top_dir)
minetest.set_node(frontpos, {name="default:dirt"})
minetest.set_node(toppos, {name="default:cobble"})
-- local found_net, merge_list = check_merge(pos)
--if found_net == 0 then
-- local net = new_network(pos)
--end
-- try_merge(merge_list)
--save_data()
end,
--after_destruct = bitumen.pipelines.after_destruct,
})
local storage_tank_builder_formspec =
"size[10,8;]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[context;main;0,0.3;4,3;]" ..
"button[5,1;1,4;build;Build]" ..
"list[current_player;main;0,3.85;8,1;]" ..
"list[current_player;main;0,5.08;8,3;8]" ..
"listring[context;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 3.85)
minetest.register_node("bitumen:storage_tank_constructor", {
description = "Storage Tank Constructor",
drawtype = "normal",
paramtype2 = "facedir",
on_rotate = screwdriver.rotate_simple,
groups = {cracky=1},
tiles = {
"default_copper_block.png","default_tin_block.png",
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("main", 12)
meta:set_string("formspec", storage_tank_builder_formspec);
end,
on_receive_fields = function(pos, form, fields, player)
local meta = minetest.get_meta(pos)
if fields.build then
-- tanks can only be built on thick foundations
local ret = bitumen.check_foundation(
{x = pos.x - 15, y = pos.y - 3, z = pos.z - 15},
{x = pos.x + 15, y = pos.y - 1, z = pos.z + 15},
{
["default:steelblock"] = 1,
["bitumen:concrete"] = 1,
}
)
if ret == false then
minetest.chat_send_player(player:get_player_name(), "Foundation is incomplete: 15x3x15")
return
else
minetest.chat_send_player(player:get_player_name(), "Foundation is complete.")
end
-- tanks need room
local ret = bitumen.check_foundation(
{x = pos.x - 16, y = pos.y , z = pos.z - 16},
{x = pos.x + 16, y = pos.y + 12, z = pos.z + 16},
{
["air"] = 1,
["bitumen:storage_tank_constructor"] = 1,
}
)
if ret == false then
minetest.chat_send_player(player:get_player_name(), "Area is not clear: 16x12x16")
return
else
minetest.chat_send_player(player:get_player_name(), "Area is clear.")
end
local inv = meta:get_inventory();
-- should be ~1500 sheets
if (inv:contains_item("main", "bitumen:galv_steel_sheet 99") and
inv:contains_item("main", "default:coal_lump 20")) then
inv:remove_item("main", "bitumen:galv_steel_sheet 99")
inv:remove_item("main", "default:coal_lump 20")
else
minetest.chat_send_player(player:get_player_name(), "Not enough materials: 99x Galvanized Steel Sheet, 20x Coal Lump")
return
end
-- ready to go
minetest.chat_send_player(player:get_player_name(), "Clear area, construction starting...")
for i = 9,1,-1 do
minetest.after(10-i, (function(n)
return function()
minetest.chat_send_player(
player:get_player_name(),
"Storage Tank construction in "..n.."..."
)
end
end)(i))
end
minetest.after(10, function()
minetest.set_node(pos, {name="bitumen:storage_tank"})
end)
end
end,
})
bitumen.register_blueprint({
name = "bitumen:storage_tank",
})
minetest.register_node("bitumen:storage_tank", {
paramtype = "light",
drawtype = "mesh",
mesh = "storage_tank.obj",
description = "Storage Tank",
tiles = {
"default_sand.png",
},
inventory_image = "default_sand.png",
selection_box = {
type = "fixed",
fixed = {
{ -.5, -.5, -.5, .5, 1.5, .5 },
-- { -8.2, -.5, -.2, -7.8, 10, .2 },
-- { -.2, -.5, -8.2, .2, 10, -7.8 },
-- { 8.2, -.5, -.2, 7.8, 10, .2 },
-- { -.2, -.5, 8.2, .2, 10, 7.8 },
},
},
collision_box = {
type = "fixed",
fixed = {
{ -.5, -.5, -.5, .5, 1.5, .5 },
}
},
paramtype2 = "facedir",
groups = {choppy=1, petroleum_fixture=1, bitumen_magic_proof=1 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
if placer then
local owner = placer:get_player_name()
meta:set_string("owner", owner)
end
-- meta:set_float("fluid_level", 0)
-- meta:set_float("capacity", math.floor(3.14159 * .75 * 9 * 9 * 9 * 64))
-- meta:set_string("infotext", "0%")
bitumen.magic.set_collision_nodes(pos, bitumen.magic.gencylinder({0, 0, 0}, 14.99, 9))
-- bitumen.pipes.on_construct(pos)
end,
on_destruct = bitumen.magic.on_destruct,
can_dig = function(pos, player)
-- local meta = minetest.get_meta(pos);
-- local owner = meta:get_string("owner")
-- local fluid_level = meta:get_float("fluid_level") or 0
-- return player:get_player_name() ~= owner and fluid_level <= 0.01
return true
end,
})

View File

@ -122,6 +122,7 @@ end
-- TODO: wool, stairs, walls, seasons
for _,n in ipairs(spill_nodes) do
register_spill_node(n)
end