move renderscad into Level model
This commit is contained in:
parent
7b141aa87b
commit
756c3976d0
3 changed files with 36 additions and 14 deletions
|
@ -1,17 +1,9 @@
|
|||
import os
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from c3nav.mapdata.utils.scad import polygon_scad
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'render the map to openscad'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
from c3nav.mapdata.models import AltitudeArea
|
||||
filename = os.path.join(settings.RENDER_ROOT, 'all.scad')
|
||||
with open(filename, 'w') as f:
|
||||
for area in AltitudeArea.objects.all():
|
||||
f.write('translate([0, 0, %.2f]) ' % area.altitude)
|
||||
f.write(polygon_scad(area.geometry)+';\n')
|
||||
from c3nav.mapdata.models import Level
|
||||
Level.render_scad_all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue