vanowm Posted April 15 Share Posted April 15 (edited) This is a complimentary to splinedit command, which allow add/remove fit points to a spline with one click. No need preselect existing fit point, it will automatically insert new fit point at the click location. New command: spledit or sple It has a "Closest" option: when enabled will insert fit points on spline itself even when clicked away from the spline. I use splines a lot to trace around images, so having ability simply click to add/remove fit points is a time saver. One other thing I'd like to improve this upon is ability to drag the fit points around while mouse button is pressed down on it, and remove it after button released without moving mouse. So far, I have not found a way to do it... As of 2024-05-02 5:54 there are 2 options "drag New" and "drag Existing". When enabled newly created fit point could be moved around, same for existing fit points when "drag Existing" is enabled. The reason for the second option is whether you want single click to delete a point, or two clicks, but with ability move it too. captura-2024-04-15-11-38-35.mp4 spledit.lsp Edited 2 hours ago by vanowm latest version 2024-05-02 5:54 Quote Link to comment Share on other sites More sharing options...
XDSoft Posted April 16 Share Posted April 16 Dynamically insert SPLINE FIT points The code below, using XDRX - API, Before trying the forum code, please download and install XDRX - API xdcad/XDrx-API: Autolisp development library written in ObjectARX (github.com) https://github.com/xdcad/XDrx-API =================================== (defun c:xdtb_spldynfit (/ dynpt fitpnt inx lastpnt spl) (defun _callback (dynpt) (if (not (equal dynpt lastpnt)) (xdrx-spline-setfitpointat spl inx dynpt) ) (setq lastpnt dynpt) ) (xdrx-begin) (xdrx-sysvar-push '("osmode" 512)) (if (and (setq spl (car (xdrx-entsel (xdrx-string-multilanguage "\n拾取SPLINE<退出>:" "\nPick Spline<Exit>:") '((0 . "spline")) ) ) ) (xdrx-entity-redraw spl 1) (setq fitpnt (getpoint (xdrx-string-multilanguage "\n点取新增Fit点位置<退出>:" "\nClick to select the new Fit point location<Exit>:"))) (setq inx (xdrx-spline-insertfitpointat spl fitpnt)) ) (progn (xdrx-entity-redraw spl 4) (xdrx-pointmonitor "_callback") (getpoint) (xdrx-pointmonitor) ) ) (xdrx-sysvar-pop) (xdrx-end) (princ) ) Quote Link to comment Share on other sites More sharing options...
vanowm Posted April 16 Author Share Posted April 16 That looks very interesting, but...I'm a bit skeptical installing an exe file from a chinese website (especially that it appeared on github 6 hours ago as zip downloads, which is not what github is for!) Quote Link to comment Share on other sites More sharing options...
XDSoft Posted April 16 Share Posted April 16 12 minutes ago, vanowm said: That looks very interesting, but...I'm a bit skeptical installing an exe file from a chinese website (especially that it appeared on github 6 hours ago as zip downloads, which is not what github is for!) Putting it on github provides a convenient download link for foreign netizens. It wasn't put up just 6 hours ago. It has been on github, but it was updated 6 hours ago. Quote Link to comment Share on other sites More sharing options...
lrm Posted April 16 Share Posted April 16 @vanowm I'd like to suggest that you experiment with using Control Vertices for editig the shape of a spline. Manipulating CVs can give you great dynamic curvature control without the risk of adding unwanted undulations. Keep in mind that the fewer the fit points, or CVs, the more likely that you will have a smoother curve. When I want to trace a shape I make a first attempt by using the fit point method. splinedit edit move is then used to slightly move one of the fit points. Once you move a fit point all of the fit points will dissapear from that point on you you can directly move CVs to edit the shape without needing to use splinedit e m. Clicking on the spline highlights the CVs and you can click on one and drag it while dynamically seeing the change it makes. If you need more shape control for a particular segment of the spline you can add a CV via splinedit e a. Quote Link to comment Share on other sites More sharing options...
vanowm Posted April 16 Author Share Posted April 16 @lrm The problem is I'm exporting my drawings to another program, which doesn't like CV splines. Also, in some cases you'd have to zoom way out in order to reach needed CV, which might be undesirable. Quote Link to comment Share on other sites More sharing options...
vanowm Posted Saturday at 10:06 PM Author Share Posted Saturday at 10:06 PM (edited) @XDSoft is there a way show grips during transformation? I've tried add (SSSETFIRST nil (SSADD spl)) inside _callback function, it worked but made it unacceptably slow. [EDIT] NVM it needed to be added before (getpoint) line. Edited Sunday at 01:17 PM by vanowm Quote Link to comment Share on other sites More sharing options...
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.