Git Product home page Git Product logo

Comments (15)

florianfesti avatar florianfesti commented on June 9, 2024

To get the finger holes you have to replace the top edge with your own edge.
Basically replace the "e" here. You can steal or borrow the FingerHoleEdge from the CardBox

For the text you need to add a callback to the rectangularWall call just below. See https://florianfesti.github.io/boxes/html/api_parts.html#the-callback-parameter or most other rectangularWall calls in TypeTray. DrillBox has text placed but it does calculate the content.

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

Today I tried some coding for the fingerholes.
Now i have a code who works. But now it has always fingerholes.
I added the new choice-option "none" (Line 108). The return-value is 0. This should be the information to disable the function.
But i don't know in which file i have to edit.

BTW: Can we discuss in german here? Maybe its easier.

The actual code is appended in txt because it's not allowed *.py
typetray.txt

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

Ok, I solved the problem with the function disabling. I added just a if and it works:
typetray - with Fingerholes.txt

Now I will continue with the texts...

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

Okay, a long evening later I have a solution for all.
I didn't cut it yet, but I think, it should work. I will try it in the next few days.

Maybe you wanna check the code and give me a feedback.
typetray_Fingerholes_Text.txt

Next I want to rework some german translations. Can you tell me how to do it?

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

OK, this looks pretty nice already. I have moved the text rendering into a callback method. This make the placing a bit more straight forward.

I am a bit confused about your handling of the layout. char2string seems pretty strange and unnecessary to me. Is there a particular reason you added that?

I am also wondering if there should be an option to add the finger holes to the outside wall, too.

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

Here's the current diff master...typetext

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

I'm a PLC an robot programmer. I understand the most things about the logic in python, but I'm not good in coding a pretty file in this language. I just made it work like my preferences.

The callback method looks fine.

I used char2string just to convert a list of characters into a string. I tried to use the join-method but i couldn't get it to work. If you have a better idea, feel free.

Of course, I can add the option to add the finger-holes to the outside wall.

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

Okay, I worked on it.
The char2string is removed , now it's a join-method (see the code below)

The option to add the finger holes to the bront and back wall is not that easy I thought. I will get only one hole per wall, because the top edge is just one line (not like at the inner walls who are cutted from the vertical dividers).
Do you have an idea for that?

Heres my diff: https://github.dev/D-Platoon/boxes/blob/9520098d1dfd851b21e1a9b2695393af32214c47/boxes/generators/typetray.py

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

OK, I think even the join() should not be necessary. At least here it works without. The code for giving the text in a file is still untested. Otherwise I think I did most of the stuff we discussed here.

I am currently thinking about using the FingerHoleEdgeSettings directly in the UI and may be give the FingerHoleEdge a bit of love. This looks useful enough that it can grow a few more features. Like adjustable width and relative width and depth. Other than this I think this is pretty much done.

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

OK, made FingerHoleEdgeSettings into a proper setting and use it in the UI. I also changed the defaults to have a the same behaviour as before. So both finger holes and labels need to be switched on.

I may squash most of the patches into just a few. May be tomorrow and then just merge.

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

I wanted to try your upgrade. It looks pretty good, but I found a bug at the section of the compartment labels.
The label_text is just a line, but it should be a field. Because with the line, we can't get a differentation.
It looks like this:
grafik

But it should look like this:
grafik

I played a little bit with the code, and I found out, that if the variable is called layout, we're getting the field, otherwise we get just the line. But I don't know why...

I also think it is more useful to set the finger-holes by default with an absolute with of maybe 20mm instead of the relative widh (the thickness of your fingers is always the same - its independent from the compartment width).
And can you explain the variable radius? I tried different values but i got always the same output.

And I want to add some german translations. How can I do that?
E.g. "Forderseite" is written wrong ;-)

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

Weird. The label_text works for me both locally and on the web instance. May be you are missing some patches. cc78633 most likely.

The radius is meant to be the radius at the bottom of the finger holes. Turns out it wasn't hooked up to anything, though. Fixed with ad10104

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

The translation source files can be found in po/

from boxes.

D-Platoon avatar D-Platoon commented on June 9, 2024

Okay, i didn't made a complete clone of the repository. My fault, sorry!

Also now the radius value make sense.

I think, I will test and cut today a small tray.

Thanks for the location of the language files. Think, I will update it in the next few days.

from boxes.

florianfesti avatar florianfesti commented on June 9, 2024

While it's non of my business and really not prerequisite for contributing to Boxes.py, I still strongly suggest to learn git. It has changed the way I look at coding a lot to the better and having an easy way to rebase or merge branches is invaluable.

from boxes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.