python import > how to create a point?

ky's Avatar

ky

23 Feb, 2013 02:05 AM

Hello,
I tried to create a point using python but it did not work well.
How should I do it? Please let me know. Thank you.

Best,
ky

  1. Support Staff 1 Posted by Frederik De Ble... on 24 Feb, 2013 09:19 PM

    Frederik De Bleser's Avatar

    Hi,

    You're intuition was right, but NodeBox is wrong :-)

    We're currently reworking the graphics API so that you can just create a map containing X/Y and have it be represented as a point. For now you have to use the Point object:

    from nodebox.graphics import Point
    
    def my_point(x, y):
        return Point(x, y)
    

    Again, since the API is in flux I can't guarantee this code will keep working in the future.

    Kind regards,

    F

  2. Frederik De Bleser closed this discussion on 24 Feb, 2013 09:19 PM.

  3. ky re-opened this discussion on 25 Feb, 2013 04:45 PM

  4. 2 Posted by ky on 25 Feb, 2013 04:45 PM

    ky's Avatar

    Thank you for your response. I just downloaded the latest version of Nodebox3 and I realized the attached Nodes are not appeared on the menu. Could you give us some tips? Thank you :-)

    Best,
    ky

  5. Support Staff 3 Posted by Frederik De Ble... on 08 Apr, 2013 06:57 PM

    Frederik De Bleser's Avatar

    The nodes won't automatically appear on the menu. This is not supported yet. If you want to use them in another document, you have to copy-paste them.

    Obviously, this is not ideal. We're working on a fix for this.

  6. Frederik De Bleser closed this discussion on 08 Apr, 2013 06:57 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

10 Sep, 2024 03:41 AM
09 Sep, 2024 02:15 PM
07 Sep, 2024 05:16 AM
05 Sep, 2024 02:21 AM
04 Sep, 2024 05:01 AM

 

03 Sep, 2024 10:07 AM
02 Sep, 2024 05:56 AM
31 Aug, 2024 11:07 PM
27 Aug, 2024 12:08 AM
26 Aug, 2024 01:02 PM
26 Aug, 2024 07:18 AM