### https://iam.tugraz.at/diag/dm2/ue_04/_ue_04_tetra_1030.py
### grabbed:  2021-10-29 11:09:28
#################################


######################################
### DM2_w21 # AGruber@tugraz.at    ###
### ue_04_basics # tool4_tetraeder ###
######################################

##############################
import rhinoscriptsyntax as rs
import random, time, itertools
import sys
sys.path.append("P:/")     ### add path to rhino's default/search path
import dm2_lib as dm2
##############################

rs.UnitSystem(4)                                        # km = 5, meters = 4, cm = 3 etc
rs.Command("-groundplane Options On=No enter enter", 0) # groundplane > off
rs.ShowGrid(None, 0)
rs.ShowGridAxes(None, 0)
rs.EnableRedraw(0)


print "                            /\\       "
print "                           /_|\\      "
print "                      TETR/  |_\\EDER _01"
print "........................./   |  \\....... h = a/3.0*(6.0**0.5) .. \" a drittel mal wurzel aus 6 \"\n"


dm2.eA()

ptA - [3, 0, 0]
ptB - [0, 3, 0]
ptX - [3, 3, 3]

rs.AddPoints( [ptA, ptB, ptX])
rs.AddLine( ptA, ptB)

A = rs.Distance(ptA, ptB)



###############################################
#___4_lazy_experts: automated capture to LW P:/
if 1:
    rs.ZoomExtents()
    rs.Command("-zoom Factor 0.95 enter", 0) # decrease zoom for better framingg
    rs.Redraw()
if  0:
    path = "P:/hu_03/images/"
    name = "tst.png"
    rs.Command("-viewCaptureToFile Width=480  Height=360  Scale=1.5 DrawCPlaneAxes=No TransparentBackground=Yes "+path+name, 0)
    # .jpg and Scale=4 for webSite submission
    name = "tst_"+str(int(time.time()))+".jpg"
    rs.Command("-viewCaptureToFile Width=480  Height=360  Scale=4 TransparentBackground=No  "+path+name, 0)