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

16 Feb, 2025 11:13 AM
15 Feb, 2025 12:51 PM
06 Feb, 2025 01:37 AM
04 Feb, 2025 06:32 AM
04 Feb, 2025 05:04 AM

 

30 Jan, 2025 09:31 AM
30 Jan, 2025 09:08 AM
30 Jan, 2025 08:40 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM