LDBoxer


LDBoxer
#1
I was wondering if someone could take a look at the source code to this program:

https://sourceforge.net/projects/ldrawboxer/

Currently it is not working properly for me. I used it in the past, so I know it *can* work. The developer said it might have something to do with long file names. He also said he is not feeling well, so he may not work on it any more.

Does anyone here have Delphi and can update the code? It is not a large program. If it was FreePascal I might take a stab at it myself.

Bonus feature request: I would also like to be able to use this tool from the command line, since I have a directory full of models that need to be converted.

Thanks everyone!
Reply
RE: LDBoxer
#2
Here's my path to LDBoxer:

Code:
E:\Programs Windows\LDraw\ldboxer\LDBoxer2010a.exe

Here's my path to %LDRAWDIR%:

Code:
C:\Users\Public\Documents\LDraw\parts

Here's the path to my model:

Code:
D:\Datsville\datsville_boxed_half\building_057_castletavern.ldr

I am able to load the model in LDBoxer, but am unable to process the file. LDBoxer does nothing when I press the AutoCheck button.

Looking at the program source code, can you see what might be causing this?
Reply
RE: LDBoxer
#3
Okay, the problem was that the "ldraw.ini" file was not set correctly. Once I set it correctly the program worked.

Is this file obsolete? What is the replacement method of finding the LDraw directory?
Reply
RE: LDBoxer
#4
I did acting version of the command line. However, before it delivers. I wanted to ask for access to the file before | after modification via LDraw Boxer, to make sure that my version works just as well as the original.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#5
(2017-03-16, 20:54)Jarema Wrote: I did acting version of the command line. However, before it delivers. I wanted to ask for access to the file before | after modification via LDraw Boxer, to make sure that my version works just as well as the original.

I don't understand what you are saying. I'm sorry.
Reply
RE: LDBoxer
#6
I'm sorry for you too. So give me this file(s) that you use with tool before covered it. And I check by my self how my version work. OK.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#7
I created repository for this utility here: https://github.com/Jeremy1980/LDBoxer
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#8
(2017-03-18, 13:30)Jarema Wrote: I created repository for this utility here: https://github.com/Jeremy1980/LDBoxer

I have more boxes here:

http://www.mediafire.com/file/dc1sx16tw2...170409.zip


Mike
Reply
RE: LDBoxer
#9
(2017-03-18, 13:30)Jarema Wrote: I created repository for this utility here: https://github.com/Jeremy1980/LDBoxer

I forgot, but where do I put the box parts? Are the box parts the same as Tore Eriksson's?

Assuming they are located in:

"C:\Users\Public\Documents\LDraw\parts\b"

I am unable to process the following file:

http://www.mediafire.com/file/y56s7dj77v...d_half.zip

The program simply says "Boxed 0 parts" and then quits.

Could you take a look please?
Reply
RE: LDBoxer
#10
Roger that. I Take this in my free-time.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#11
(2018-01-10, 7:41)Jarema Wrote: Roger that. I Take this in my free-time.

Thank you.
Reply
RE: LDBoxer
#12
(2018-01-10, 7:41)Jarema Wrote: Roger that. I Take this in my free-time.

I have started fixing it myself, but the script now boxes every single part, so I must have made a mistake somewhere. Can you find the error?

Code:
'''
Created on 16 mar 2017
Updated on 10 jan 2018
@author: Jeremy Czajkowski
@author: Tore Eriksson <[email protected]>
@author: Michael Horvath
@license: GNU General Public License version 3
@version: 2017c
@note: A utility to help you replace LDraw parts with no visible studs or tubes with boxes.
       Saves rendering time and CPU power.
'''

import os
import sys
from macpath import dirname

__appname__ = "LDBoxer"
__version__ = "2017c"

NOTFOUND_MSG = "FileNotFoundError: [Errno 2] No such file or directory: '%s'"
INVALIDACCESS_MSG = "ImportError: Invalid access to %s."

CHKLST_INFILE = []
REPLACEDTOTAL_COUNT = 0

LDRAWPATH = MODELPATH = ""


def isBox(fil):    # mjh
    if fil[0:2].upper() == "B\\":
        return True
    else:
        return False


def ldLineType(ldline):
    result = -1;
    s = ldline.strip()
    if len(s)>0 :
        if s[0]=='0' : result = 0    # mjh
        if s[0]=='1' : result = 1    # mjh
        if s[0]=='2' : result = 2    # mjh
        if s[0]=='3' : result = 3    # mjh
        if s[0]=='4' : result = 4    # mjh
        if s[0]=='5' : result = 5    # mjh
    return result

def ldLineUpdate(ldline, ItemNr, NewVal):
    color1 = ldExtractFromLine(ldline, 2)
    x1 = float(ldExtractFromLine(ldline, 3))
    y1 = float(ldExtractFromLine(ldline, 4))
    z1 = float(ldExtractFromLine(ldline, 5))
    a1 = float(ldExtractFromLine(ldline, 6))
    b1 = float(ldExtractFromLine(ldline, 7))
    c1 = float(ldExtractFromLine(ldline, 8))
    d1 = float(ldExtractFromLine(ldline, 9))
    e1 = float(ldExtractFromLine(ldline, 10))
    f1 = float(ldExtractFromLine(ldline, 11))
    g1 = float(ldExtractFromLine(ldline, 12))
    h1 = float(ldExtractFromLine(ldline, 13))
    i1 = float(ldExtractFromLine(ldline, 14))
    fil = ldExtractFromLine(ldline, 15)
    
    if ItemNr == 2:
        color1 = NewVal
    if ItemNr == 3:
        x1 = float(NewVal)
    if ItemNr == 4:
        y1 = float(NewVal)
    if ItemNr == 5:
        z1 = float(NewVal)
    if ItemNr == 6:
        a1 = float(NewVal)
    if ItemNr == 7:
        b1 = float(NewVal)
    if ItemNr == 8:
        c1 = float(NewVal)
    if ItemNr == 9:
        d1 = float(NewVal)
    if ItemNr == 10:
        e1 = float(NewVal)
    if ItemNr == 11:
        f1 = float(NewVal)
    if ItemNr == 12:
        g1 = float(NewVal)
    if ItemNr == 13:
        h1 = float(NewVal)
    if ItemNr == 14:
        i1 = float(NewVal)
    if ItemNr == 15:
        fil = NewVal
    
    s = '1 ' + color1 + ' '
    s = s + FloatToLDraw(x1)+ ' '
    s = s + FloatToLDraw(y1)+ ' '
    s = s + FloatToLDraw(z1)+ ' '
    s = s + FloatToLDraw(a1)+ ' '
    s = s + FloatToLDraw(b1)+ ' '
    s = s + FloatToLDraw(c1)+ ' '
    s = s + FloatToLDraw(d1)+ ' '
    s = s + FloatToLDraw(e1)+ ' '
    s = s + FloatToLDraw(f1)+ ' '
    s = s + FloatToLDraw(g1)+ ' '
    s = s + FloatToLDraw(h1)+ ' '
    s = s + FloatToLDraw(i1)+ ' '
    s = s + fil
    return s

def ldExtractFromLine (ldline, post):
    post -= 1    # mjh
    t = []
    
    s = ldline.strip()
    iT = 0;    # mjh
    while s <> '':
        s = s.strip() + ' '
        i = 0    # mjh
        while s[i] <> ' ': i += 1
#         t[iT] = Copy(s, 1, i-1)
#         function Copy(const S: string; From: integer = 1; Count: integer = MaxInt): string;
        t.insert(iT, s[0:i])    # mjh
        iT += 1
        s = s[i+1:]    # mjh
    
    result = ''
    if post < iT: result = t[post]
    return result
    

def FloatToLDraw(inval):
    if (inval > -0.0001) and (inval < 0.0001): inval = 0
    return '%.5f' % (round(inval*10000)/10000)


def cmdReplace():
    replacedCount = 0
    for i in range(CHKLST_INFILE.__len__()):
        ldline = CHKLST_INFILE[i]
        if ldLineType(ldline) == 1 :
            fil = ldExtractFromLine(ldline, 15)
            if isBox(fil) == False : fil = strPrefix + fil
            fname = os.path.join(LDRAWPATH ,'Parts' ,fil)
            if os.path.exists(fname):
                ldline = ldLineUpdate(ldline, 15, fil)
                CHKLST_INFILE[i] = ldline + "\r\n"
                replacedCount += 1;
                global REPLACEDTOTAL_COUNT;
                REPLACEDTOTAL_COUNT += 1;
    if replacedCount>0 :
        CHKLST_INFILE.append("0 // Boxed {0} parts ({1})\r\n".format(replacedCount ,strPrefix))

if __name__ == '__main__':
    if sys.argv.__len__() != 3:
        print "Invalid arguments"
        sys.exit(2)
        
    LDRAWPATH = sys.argv[1]    # mjh, don't change
    MODELPATH = sys.argv[2]    # mjh, don't change
    
    if not os.path.isdir(LDRAWPATH):
        print NOTFOUND_MSG % LDRAWPATH
        sys.exit(2)
        
    if not os.path.isfile(MODELPATH):
        print NOTFOUND_MSG % MODELPATH
        sys.exit(2)
    
    try:
        with open(MODELPATH ,"r") as f:
            for line in f:
                CHKLST_INFILE.append(line)
            f.close()
    except:
        CHKLST_INFILE = []
        print INVALIDACCESS_MSG % MODELPATH
        sys.exit(2)
    
    else:
        print __appname__ ,__version__ ,"processing" ,MODELPATH
        
        i = ii = iii = frg = 0
        x1 = y1 = z1 = a1 = c1 = g1 = i1 = x2 = y2 = z2 = x3 = y3 = z3 = 0.0
        s = ldline = fil = ""
        SkipThis = False
        StrLstCover = []
        StrListInfil = []
        
        """
         cmdFittingsClick STEP 1: Compile a list of locations (20x20LDU)
         Tops and Bottoms that are hiding (=covering) details from next part
         Save the list in StrListCover
        """
        for i in range(CHKLST_INFILE.__len__()):
            ldline = CHKLST_INFILE[i]
            if ldLineType(ldline) <> 1: continue
            
            frg = int(ldExtractFromLine(ldline, 2));
            if (frg>31) and (frg<48): continue
            
            if ldExtractFromLine(ldline, 7) <> '0' : continue
            if ldExtractFromLine(ldline, 9) <> '0' : continue
            if ldExtractFromLine(ldline, 10) <> '1' : continue
            if ldExtractFromLine(ldline, 11) <> '0' : continue
            if ldExtractFromLine(ldline, 13) <> '0' : continue
            
            fil = ldExtractFromLine(ldline ,15);
            if len(fil)<5: continue # just to be foolproof...
            """
             2010-03-20 also check if already boxed parts cover positions
             by removing B\, B\t, or B\B from examined file reference
            """
            if fil[0:3].upper() == "B\\T":    # mjh
                fil = fil[3:]    # mjh
            
            if fil[0:3].upper() == "B\\B":    # mjh
                fil = fil[3:]    # mjh
            
            if fil[0:2].upper() == "B\\":    # mjh
                fil = fil[2:]    # mjh
            
            if len(fil)<5 : continue
            
            fil = fil[0:(len(fil)-4)]    # mjh
            
            fil = os.path.join(LDRAWPATH ,'Parts' ,'B' ,fil + '.nfo')
            
            print "Searching for" ,fil
            if not os.path.exists(fil) : continue
            
            x1 = float(ldExtractFromLine(ldline ,3))
            y1 = float(ldExtractFromLine(ldline ,4))
            z1 = float(ldExtractFromLine(ldline ,5))
            a1 = float(ldExtractFromLine(ldline ,6))
            c1 = float(ldExtractFromLine(ldline ,8))
            g1 = float(ldExtractFromLine(ldline ,12))
            i1 = float(ldExtractFromLine(ldline ,14))
            
            NFOCONTENT = []
            try:
                with open(fil ,"r") as f:
                    for line in f:
                        NFOCONTENT.append(line)
                    f.close()
            except:
                NFOCONTENT = []
                print INVALIDACCESS_MSG % fil
            
            StrListInfil = []
            StrListInfil.extend(NFOCONTENT)
            for ii in range(StrListInfil.__len__()):
                ldline = StrListInfil[ii]
                s = ldExtractFromLine(ldline, 1)
                x2 = float(ldExtractFromLine(ldline, 2))
                y2 = float(ldExtractFromLine(ldline, 3))
                z2 = float(ldExtractFromLine(ldline, 4))
                
                if s=='Top' or s=='Stud' : s = 'T '
                if s=='Bottom' : s = 'B '
                
                x3 = x1 + x2*a1 + z2*c1
                y3 = y1 + y2
                z3 = z1 + x2*g1 + z2*i1
                s = s + FloatToLDraw(x3) + ' '
                s = s + FloatToLDraw(y3) + ' '
                s = s + FloatToLDraw(z3)
                StrLstCover.append(s)
        
        """
         END of cmdFittingsClick STEP 1
         The model file in chklstInfile has been scanned for locations
          meeting all the given criterias
         For example:
         This following line meets the criteria:
         1 15  240 -48 160  1 0 0  0 1 0  0 0 1  3005.dat
         The two lines from the file Parts\B\3005.nfo is used:
         Stud 0 0 0
         Bottom 0 24 0
         The output stored in StrListCover is the following two lines:
         T 240 -48 160
         B 240 -24 160
        """
        
        
        """
         cmdFittingsClick STEP 2: Replace all parts that can be fully boxed
          Checkbox all parts that has all stud and bottom locations covered
          according to StrListCover
        """

        for i in range(CHKLST_INFILE.__len__()):
            ldline = CHKLST_INFILE[i]
            if ldLineType(ldline) <> 1 : continue;
            frg = int(ldExtractFromLine(ldline, 2))
            if (frg>31) and (frg<48) : continue
            if ldExtractFromLine(ldline, 7) <> '0' : continue
            if ldExtractFromLine(ldline, 9) <> '0' : continue
            if ldExtractFromLine(ldline, 10) <> '1' : continue
            if ldExtractFromLine(ldline, 11) <> '0' : continue
            if ldExtractFromLine(ldline, 13) <> '0' : continue
            fil = ldExtractFromLine(ldline, 15)
            if len(fil)<5 : continue
            
            fil = fil[0:(len(fil)-4)]    # mjh
            
            fil = os.path.join(LDRAWPATH ,'Parts' ,'B' ,fil + '.dat')
            if not os.path.exists(fil):  continue
            
            fil = fil[0:(len(fil)-4)]
            fil = fil + '.nfo';
            if not os.path.exists(fil): continue
            x1 = float(ldExtractFromLine(ldline, 3))
            y1 = float(ldExtractFromLine(ldline, 4))
            z1 = float(ldExtractFromLine(ldline, 5))
            a1 = float(ldExtractFromLine(ldline, 6))
            c1 = float(ldExtractFromLine(ldline, 8))
            g1 = float(ldExtractFromLine(ldline, 12))
            i1 = float(ldExtractFromLine(ldline, 14))
            
            NFOCONTENT = []
            try:
                with open(fil ,"r") as f:
                    for line in f:
                        NFOCONTENT.append(line)
                    f.close()
            except:
                NFOCONTENT = []
                print INVALIDACCESS_MSG % fil
            
            StrListInfil = []
            StrListInfil.extend(NFOCONTENT)
            SkipThis = False
            for ii in range(StrListInfil.__len__()):
                ldline = StrListInfil[ii]
                s = ldExtractFromLine(ldline, 1)
                x2 = float(ldExtractFromLine(ldline, 2))
                y2 = float(ldExtractFromLine(ldline, 3))
                z2 = float(ldExtractFromLine(ldline, 4))
                if s =='Top' : continue
                if s =='Stud' : s = 'B '      # Scan for matching B
                if s =='Bottom' : s = 'T '    # Scan for matching T
                x3 = x1 + x2*a1 + z2*c1
                y3 = y1 + y2
                z3 = z1 + x2*g1 + z2*i1
                s = s + FloatToLDraw(x3) + ' '
                s = s + FloatToLDraw(y3) + ' '
                s = s + FloatToLDraw(z3)
                SkipThis == True
                for iii in range(StrLstCover.__len__()):
                    if s==StrLstCover[iii] : SkipThis = False
                if SkipThis : break
            if SkipThis : continue
    
        strPrefix = "B\\"
        cmdReplace()

        """
          END of cmdFittingsClick STEP 2
        """    
      
      
        """
          cmdFittingsClick STEP 3: Replace all parts that studs can be removed from
          (STEPs 3 & 4 should be easily baked into STEP 2...)
        """
        for i in range(CHKLST_INFILE.__len__()):
            ldline = CHKLST_INFILE[i]
            if ldLineType(ldline) <> 1: continue;
            frg = int(ldExtractFromLine(ldline, 2));
            if (frg>31) and (frg<48) : continue;
            if ldExtractFromLine(ldline, 7) <> '0' : continue
            if ldExtractFromLine(ldline, 9) <> '0' : continue
            if ldExtractFromLine(ldline, 10) <> '1' : continue
            if ldExtractFromLine(ldline, 11) <> '0' : continue
            if ldExtractFromLine(ldline, 13) <> '0' : continue
            fil = ldExtractFromLine(ldline, 15);
            if len(fil)<5 : continue
            fil = fil[0:(len(fil)-4)]    # mjh
            fil = os.path.join(LDRAWPATH ,'Parts' ,'B' ,fil + '.dat')
            if not os.path.exists(fil) : continue
            fil = fil[0:(len(fil)-4)]    # mjh
            fil = fil + '.nfo'
            if not os.path.exists(fil) : continue
            x1 = float(ldExtractFromLine(ldline, 3))
            y1 = float(ldExtractFromLine(ldline, 4))
            z1 = float(ldExtractFromLine(ldline, 5))
            a1 = float(ldExtractFromLine(ldline, 6))
            c1 = float(ldExtractFromLine(ldline, 8))
            g1 = float(ldExtractFromLine(ldline, 12))
            i1 = float(ldExtractFromLine(ldline, 14))
            
            NFOCONTENT = []
            try:
                with open(fil ,"r") as f:
                    for line in f:
                        NFOCONTENT.append(line)
                    f.close()
            except:
                NFOCONTENT = []
                print INVALIDACCESS_MSG % fil
            
            StrListInfil = []
            StrListInfil.extend(NFOCONTENT)
            SkipThis = False
            for ii in range (StrListInfil.__len__()) :
                ldline = StrListInfil[ii]
                s = ldExtractFromLine(ldline, 1)
                x2 = float(ldExtractFromLine(ldline, 2))
                y2 = float(ldExtractFromLine(ldline, 3))
                z2 = float(ldExtractFromLine(ldline, 4))
                if s =='Top' : continue
                #if s == 'Stud': continue
                if s =='Stud' : s = 'B '      # Scan for matching B
                if s =='Bottom' : continue
                #if s == 'Bottom': s = 'T '    # Scan for matching T
                x3 = x1 + x2*a1 + z2*c1
                y3 = y1 + y2
                z3 = z1 + x2*g1 + z2*i1
                s = s + FloatToLDraw(x3) + ' '
                s = s + FloatToLDraw(y3) + ' '
                s = s + FloatToLDraw(z3)
                SkipThis = True;
                for iii in range (StrLstCover.__len__()) :
                    if s==StrLstCover[iii] : SkipThis = False
                if SkipThis : break
            if SkipThis : continue
        strPrefix = 'B\\T'
        cmdReplace()
        """
          END of cmdFittingsClick STEP 3
        """
      
      
        """
         cmdFittingsClick STEP 4: Replace all parts that bottom details
          can be removed from
         (STEPs 3 & 4 should be easily baked into STEP 2...)
        """
        for i in range (CHKLST_INFILE.__len__()) :
            ldline = CHKLST_INFILE[i];
            if ldLineType(ldline) <> 1 : continue;
            frg = int(ldExtractFromLine(ldline, 2));
            if (frg>31) and (frg<48) : continue;
            if ldExtractFromLine(ldline, 7) <> '0' : continue;
            if ldExtractFromLine(ldline, 9) <> '0' : continue;
            if ldExtractFromLine(ldline, 10) <> '1' : continue;
            if ldExtractFromLine(ldline, 11) <> '0' : continue;
            if ldExtractFromLine(ldline, 13) <> '0' : continue;
            fil = ldExtractFromLine(ldline, 15);
            if len(fil)<5 : continue
            fil = fil[0:(len(fil)-4)]    # mjh
    
            fil = os.path.join(LDRAWPATH ,'Parts' ,'B' ,fil + '.dat')
            if not os.path.exists(fil) : continue
            fil = fil[0:(len(fil)-4)]    # mjh
            fil = fil + '.nfo'
          
            if not os.path.exists(fil) : continue
          
            x1 = float(ldExtractFromLine(ldline, 3))
            y1 = float(ldExtractFromLine(ldline, 4))
            z1 = float(ldExtractFromLine(ldline, 5))
            a1 = float(ldExtractFromLine(ldline, 6))
            c1 = float(ldExtractFromLine(ldline, 8))
            g1 = float(ldExtractFromLine(ldline, 12))
            i1 = float(ldExtractFromLine(ldline, 14))
            
            NFOCONTENT = []
            try:
                with open(fil ,"r") as f:
                    for line in f:
                        NFOCONTENT.append(line)
                    f.close()
            except:
                NFOCONTENT = []
                print INVALIDACCESS_MSG % fil
            
            StrListInfil = []
            StrListInfil.extend(NFOCONTENT)
            SkipThis = False
            for ii in range (StrListInfil.__len__()) :
                ldline = StrListInfil[ii];
                s = ldExtractFromLine(ldline, 1)
                x2 = float(ldExtractFromLine(ldline, 2))
                y2 = float(ldExtractFromLine(ldline, 3))
                z2 = float(ldExtractFromLine(ldline, 4))
                if s=='Top' : continue
                if s=='Stud' : continue
                if s=='Stud' : s = 'B '    # Scan for matching B
                #if s=='Bottom' : continue
                if s=='Bottom' : s = 'T '  # Scan for matching T
                x3 = x1 + x2*a1 + z2*c1
                y3 = y1 + y2
                z3 = z1 + x2*g1 + z2*i1
                s = s + FloatToLDraw(x3) + ' '
                s = s + FloatToLDraw(y3) + ' '
                s = s + FloatToLDraw(z3)
                SkipThis = True
                for iii in range (StrLstCover.__len__()) :
                    if s==StrLstCover[iii] : SkipThis = False
                if SkipThis : break
            if SkipThis : continue
        strPrefix = 'B\\B'
        cmdReplace()
        """
          END of cmdFittingsClick STEP 4
        """  
        
        print
        print "Boxed %d parts" % REPLACEDTOTAL_COUNT
                
        if REPLACEDTOTAL_COUNT>0 :      
        
        # 0 !LDOXER LEVEL info should also be automatically updated!
            CHKLST_INFILE.append("0 // Boxed Total {0} parts by {1} v{2}\r\n".format(REPLACEDTOTAL_COUNT ,__appname__ ,__version__))
            CHKLST_INFILE.append("0")

            try:
                dirname = os.path.dirname(MODELPATH)
                basename = "boxed_" + os.path.basename(MODELPATH)
                with open(os.path.join(dirname,basename) ,"wb") as f:
                    for line in CHKLST_INFILE:
                        f.write(line)
                    f.close()
            except Exception, ex:
                print ex.message
            else:
                print "Saved {0} in {1}".format(basename ,dirname)

[edit]

I updated the code with a few fixes.
Reply
RE: LDBoxer
#13
Sorry for late response. I do not have much time for this. I don't know what is wrong with Python code, so i roll up to Pascal code.
You can download from here http://jaremaczajkowski.pl/pub/forum/LDB...Source.zip.

I do not have idea why Tore Eriksson search files in %LDRAWPATH%\PARTS\B except S directory, but i stay as isIt is possible that some things were bad from the beginning.
After close application, you can look on activity log in file ldboxer_stdout.txt
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#14
(2018-01-14, 9:05)Jarema Wrote: Sorry for late response. I do not have much time for this. I don't know what is wrong with Python code, so i roll up to Pascal code.
You can download from here http://jaremaczajkowski.pl/pub/forum/LDB...Source.zip.

I do not have idea why Tore Eriksson search files in %LDRAWPATH%\PARTS\B except S directory, but i stay as isIt is possible that some things were bad from the beginning.
After close application, you can look on activity log in file ldboxer_stdout.txt

Which compiler is needed to build and run this version? Delphi is not free IIRC.
Reply
RE: LDBoxer
#15
(2018-01-14, 11:44)Michael Horvath Wrote: Which compiler is needed to build and run this version? Delphi is not free IIRC.

You can always start use FREE Trial version. Like i temporary do. By the way, write how the program works. Personally, i prefers other programming languages.

EDIT: You can download and use Lazarus from https://www.lazarus-ide.org/ as alternative too.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#16
(2018-01-14, 11:44)Michael Horvath Wrote: Which compiler is needed to build and run this version? Delphi is not free IIRC.

I think I used Delphi v7.0, and it was free since they want us to get hooked in an old free version and then upgrade to one that's not free. There were many problems with LDBoxer if my memory serves me right. The biggest was it didn't have support for long file names or whitespaces in paths or file names. The constant changes of the LDraw spec's made me give up the whole project.

And: LDBoxer - at least in my versions - does not support MPD or any SNOT application at all. I simply don't have that programming skills.
Reply
RE: LDBoxer
#17
(2018-01-15, 22:15)Tore Eriksson Wrote:
(2018-01-14, 11:44)Michael Horvath Wrote: Which compiler is needed to build and run this version? Delphi is not free IIRC.

I think I used Delphi v7.0, and it was free since they want us to get hooked in an old free version and then upgrade to one that's not free. There were many problems with LDBoxer if my memory serves me right. The biggest was it didn't have support for long file names or whitespaces in paths or file names. The constant changes of the LDraw spec's made me give up the whole project.

And: LDBoxer - at least in my versions - does not support MPD or any SNOT application at all. I simply don't have that programming skills.

It's sad that it doesn't handle MPD files properly. It's still better than nothing, though.

Do you think you could build a version that works on the command-line?

Or, could you take a look at @Jarema's and my direct translation into Python? I can get the script to run (Python scripts don't need to be compiled first, as long as you have Python installed), but there's something broken in it.

Thanks!
Reply
RE: LDBoxer
#18
(2018-01-16, 0:28)Michael Horvath Wrote:
(2018-01-15, 22:15)Tore Eriksson Wrote: I think I used Delphi v7.0, and it was free since they want us to get hooked in an old free version and then upgrade to one that's not free. There were many problems with LDBoxer if my memory serves me right. The biggest was it didn't have support for long file names or whitespaces in paths or file names. The constant changes of the LDraw spec's made me give up the whole project.

And: LDBoxer - at least in my versions - does not support MPD or any SNOT application at all. I simply don't have that programming skills.

It's sad that it doesn't handle MPD files properly. It's still better than nothing, though.

Do you think you could build a version that works on the command-line?

Or, could you take a look at @Jarema's and my direct translation into Python? I can get the script to run (Python scripts don't need to be compiled first, as long as you have Python installed), but there's something broken in it.

Thanks!

Maybe I could learn to parse MPD's. But even so, that would create new, potentially impossible problems. What if the same sub-file is used multiple times in an MPD, and the same used part should be boxed in some occations but not all of them?

Normally, I make command line programs in C and GUI programs in Delphi. That would mean I have to translate the entire program to C.

I don't speak Python, and I no longer have the capacity to teach myself a new programming environment.
Reply
RE: LDBoxer
#19
(2018-01-16, 19:22)Tore Eriksson Wrote: Maybe I could learn to parse MPD's. But even so, that would create new, potentially impossible problems. What if the same sub-file is used multiple times in an MPD, and the same used part should be boxed in some occations but not all of them?

I wouldn't worry about MPD support, then. The proper thing to do (which I've been doing) in this case is to inline all the submodels using MPDCenter.

(2018-01-16, 19:22)Tore Eriksson Wrote: Normally, I make command line programs in C and GUI programs in Delphi. That would mean I have to translate the entire program to C.

I don't speak Python, and I no longer have the capacity to teach myself a new programming environment.

Could you at least move the onscreen buttons and checkbox to the left side of the screen? Modern Windows have display DPI settings that can be changed, causing the buttons in LDBoxer to disappear.

http://www.dummies.com/computers/pcs/cha...i-setting/

You can try for yourself.
Reply
RE: LDBoxer
#20
(2017-03-18, 13:30)Jarema Wrote: I created repository for this utility here: https://github.com/Jeremy1980/LDBoxer

I think I managed to get the Python script working. See here:

https://github.com/Jeremy1980/LDBoxer/issues/5
Reply
RE: LDBoxer
#21
(2018-01-25, 2:22)Michael Horvath Wrote: I think I managed to get the Python script working. See here:

https://github.com/Jeremy1980/LDBoxer/issues/5

I created a better optimized version that is also available at the above link. Normally it is very slow due to being a Python script. However, using PyPy instead of CPython results in a huge improvement in performance!

Not sure how much faster a Pascal, C#, etc. version of this script would be. I may try again in the future.
Reply
RE: LDBoxer
#22
(2018-01-26, 9:52)Michael Horvath Wrote:
(2018-01-25, 2:22)Michael Horvath Wrote: I think I managed to get the Python script working. See here:

https://github.com/Jeremy1980/LDBoxer/issues/5

I created a better optimized version that is also available at the above link. Normally it is very slow due to being a Python script. However, using PyPy instead of CPython results in a huge improvement in performance!

Not sure how much faster a Pascal, C#, etc. version of this script would be. I may try again in the future.

I updated the script so that trailing zeros are deleted from numbers. This should reduce output model size considerably.

https://github.com/Jeremy1980/LDBoxer/issues/7
Reply
RE: LDBoxer
#23
Check Private Message.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
Reply
RE: LDBoxer
#24
Jarema gave me commit access to GitHub, so the latest version can once again be downloaded directly from the repository.

https://github.com/Jeremy1980/LDBoxer
Reply
RE: LDBoxer
#25
I was thinking that it wouldn't be too hard to process some SNOT parts as well. Basically, just apply the transformation matrix of Part A to Parts B to Z and then check for coincidence as per normal. Not sure how to code it though.
Reply
RE: LDBoxer
#26
(2018-01-10, 23:37)Michael Horvath Wrote:
Code:
'''
Created on 16 mar 2017
Updated on 10 jan 2018
@author: Jeremy Czajkowski
@author: Tore Eriksson <[email protected]>
@author: Michael Horvath
My mail address need to be updated! The swipnet address has been dead for years.

@author: Tore Eriksson <[email protected]>
Reply
RE: LDBoxer
#27
(2018-02-24, 11:07)Tore Eriksson Wrote:
(2018-01-10, 23:37)Michael Horvath Wrote:
Code:
'''
Created on 16 mar 2017
Updated on 10 jan 2018
@author: Jeremy Czajkowski
@author: Tore Eriksson <[email protected]>
@author: Michael Horvath
My mail address need to be updated! The swipnet address has been dead for years.

@author: Tore Eriksson <[email protected]>

Fixed. Thanks.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 3 Guest(s)