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

22 Feb, 2024 05:51 AM
22 Feb, 2024 01:11 AM
21 Feb, 2024 05:27 PM
21 Feb, 2024 04:49 PM
16 Feb, 2024 05:24 PM

 

06 Feb, 2024 04:45 AM
19 Jan, 2024 09:50 AM
13 Jan, 2024 03:47 AM
05 Jan, 2024 05:10 PM
05 Jan, 2024 04:54 PM
04 Jan, 2024 11:49 PM