vanowm Posted April 15, 2024 Posted April 15, 2024 (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 May 2, 2024 by vanowm latest version 2024-05-02 5:54 Quote
XDSoft Posted April 16, 2024 Posted April 16, 2024 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
vanowm Posted April 16, 2024 Author Posted April 16, 2024 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
XDSoft Posted April 16, 2024 Posted April 16, 2024 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
lrm Posted April 16, 2024 Posted April 16, 2024 @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
vanowm Posted April 16, 2024 Author Posted April 16, 2024 @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
vanowm Posted April 27, 2024 Author Posted April 27, 2024 (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 April 28, 2024 by vanowm Quote
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.