GithubHelp home page GithubHelp logo

thomthom / true-bend Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 1.0 2.49 MB

Bends instance to a given degree or radius, preserving the original length.

License: MIT License

Ruby 100.00%
sketchup extension bend ruby

true-bend's Introduction

TrueBend

SketchUp extension allowing you to bend instances to a given degree or radius, preserving the original length.

Example Usage

The length of the reference segment is preserved as the instance is bent:

Use the VCB to enter an accurate bend angle:

Use the VCB to adjust the segmentation by appending "s":

Toggle soft+smooth for the newly created edges:

VCB Input

By default the VCB accept bend angle. But you can switch to other modes by appending a unit type:

  • Angle Input: 45deg
  • Segment Count: 8s
  • Bend Distance: 500mm (This should be a value less than the width of the bottom from bounding box segment.)

true-bend's People

Contributors

thomthom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tupynamba

true-bend's Issues

Enter sagitta

There are multiple requests for entering sagitta. This is somewhat a challenge to compute (See #13). Found a solution that worked for angles less than 180 degrees. But failed after that. Maybe being able to bend up til 180 degrees can work for most cases?

Change how bend is controlled by mouse

Change to dragging the reference segment. Using Directional cursor from TT_Lib.

Draw a circular plane at mid point of reference segment, with arrows pointing in each direction - to indicate to the user that this can be interacted with.

Optimize `draw`

Lots of stuff is re-computed on every draw. Create DrawingCache (copy from other project) and split the drawing logic into bucket of when they need to re-compute.

The drawing for the selected instance doesn't change until the geometry change. This can be cached longer.

The bending preview needs to be updated upon user input.

Clear up length VCB input

Currently it says "Distance", and in the viewport you see a number for the radius. But when entering a length instead of an angle it represent the sagitta.

Need to make this clearer.

Don't reset bend handle after each adjustment

Preserve the handle size.

Or, remember the distance and make the handle adjust relative to previous value.

Right now it starts fresh using the handle as absolute adjustment value.

Enter radius

https://extensions.sketchup.com/en/comment/106756#comment-106756

it would be great to input the radius. is this possible? i mean something you can impliment?
I have a half circle with radius 3800mm. i need to break this down into 4 ft lengths (sheet size). if i could draw a 4ft length then give it a radius... solves problem - 'True Bend' keeps original length!??

This might also be challenging, similar to computing based on sagitta...

Errors after setting bend to zero

Extending non-transient object, clashing with other extensions

Dezmo has reported in the SketchUp forum that his code clashes with TrueBend, after TrueBend has been used. Calling PickHelper#pick_segment inside his namespace with seemingly malformed arguments raises an exception in TrueBend's HighDpiPickHelper.

https://forums.sketchup.com/t/truebend-re-defined-method-for-pick-segment-points/87777

It appears TrueBend is extending a PickHelper object that isn't actually transient, but reused as return value by View#pick_helper method.

https://github.com/thomthom/true-bend/blob/master/src/tt_truebend/dpi/view.rb#L126

Running this snippet over and over shows the same object ID being re-used.

Sketchup.active_model.active_view.object_id

To fix this clash, perhaps the delegation pattern could be used inside HighDpiPickHelper just as it is used HighDpiView.

Preserve UV mapping

Not sure how feasible this is, but worth a shot. Not sure how easy it will be with ngons bending etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.