DomC Posted February 24, 2016 Share Posted February 24, 2016 Maybe i just need a break or there is something strange with the "Get Circle" Node. The Radius is not as expected. rads = abs(x1)+abs(y1) hmm that can't work I think :grin: Original Code: points = vs.GetBBox(h) top_left = points[0] bottom_right= points[1] x1 =top_left[0] y1 = top_left[1] x2 = bottom_right[0] y2 = bottom_right[1] final_x = (x1 + x2)/2 final_y = (y1 + y2)/2 rads = abs(x1)+abs(y1) center = (final_x,final_y) self.Params.centerPt.value = center self.Params.radius.value = rads Modified Code: points = vs.GetBBox(h) top_left = points[0] bottom_right= points[1] x1 =top_left[0] y1 = top_left[1] x2 = bottom_right[0] y2 = bottom_right[1] x = (x2 - x1) y = (y1 - y2) rads = x/2 center = (x2-x/2,y1-y/2) self.Params.centerPt.value = center self.Params.radius.value = rads Maybe there is a better solution ... but for now, it seems to work Quote Link to comment
Marionette Maven Marissa Farrell Posted February 25, 2016 Marionette Maven Share Posted February 25, 2016 Hi Dom! In my version of SP2 this was already changed. This is the code in the release of SP2: def RunNode(self): h = self.Params.circle.value points = vs.GetBBox(h) top_left = points[0] bottom_right= points[1] x1 =top_left[0] y1 = top_left[1] x2 = bottom_right[0] y2 = bottom_right[1] final_x = (x1 + x2)/2 final_y = (y1 + y2)/2 #rads = abs(x1)+abs(y1) #TODO: remove rads = (x2 - x1)/2 center = (final_x,final_y) self.Params.centerPt.value = center self.Params.radius.value = rads Which with my brief testing works correctly. (Also, notice the "#rads = abs(x1)+abs(y1) #TODO: remove", it appears whoever fixed this way back when never completely removed the comment I'll check to see if I can take this line out soon to clean it up a bit.) Quote Link to comment
DomC Posted February 25, 2016 Author Share Posted February 25, 2016 Thanks, Marissa I Worked with the interiorcad Version Version (3rd Party). Seems they missed updating the default libraries ... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.