Code Monkey home page Code Monkey logo

Comments (6)

TheMakerTales avatar TheMakerTales commented on May 28, 2024

A nicely detailed example
#89 (comment)

from cad_sketcher.

exegetor avatar exegetor commented on May 28, 2024

The context menu (shown below) is a good place to select from [diameter, radius, linear distance radius] as well as [inside display, outside) display].
While we're at it, let's restrict the arrow so that it must touch part of the arc being referenced. (see contrived example below for an "illegal" dimension arrow)

image

If there's no rush, I'll give this a shot.

from cad_sketcher.

hlorus avatar hlorus commented on May 28, 2024

If there's no rush, I'll give this a shot.

Sure thing, if you have questions you can reach out here or on the discord's contribute channel.

from cad_sketcher.

exegetor avatar exegetor commented on May 28, 2024

There are two related issues here. The first is radius mode vs diameter mode. This may be an oversimplification, but I think an arc will always be dimensioned by radius. If we check (in _create_shape) isinstance(constr.entity1, class_defines.SlvsArc) we can go ahead and use the radius mode without any user input. If it's a circle, we would use diameter mode. I have this much working fine, but it doesn't address FR89.

For that, we need display_mode, which should offer three options: Inside (current style), Outside (Feat. Req. 89, Alt. Sol'n. #2), and Distance-style dimensioning (proposed as FR89, Alt. Sol'n #1. (Does this have a name?).

Since the helper lines are calculated in _create_shape(), we need to get draw_style over from the context menu (like with Distance alignment setting) to the gizmo. I'm still struggling with the basics of python and how these Objects communicate state to each other. If you have time to drop me a hint, maybe point out a similar mechanism already in this codebase and explain the pattern?

I'm having trouble using discord, but I'll try to get that fixed soon.

from cad_sketcher.

hlorus avatar hlorus commented on May 28, 2024

I would generally advise to try to keep changes small and concentrated rather than trying to implement everything at once.

Regarding deciding which mode to use: That seems alright, that's also something that could easily be added later if needed. IMO we could even always use the radius mode for now as the diameter mode currently clutters the center.

I would suggest as a first step to add a draw_radius (same as the draw_offset) to the angle constraint. Then use this to extend the constraint line outwards, away from the center. With this you will also have to make sure that this property gets updated correctly when dragging the constraint around. Not sure if this is a bit too much to start with but i think it's an important priority. Anyway i'm here to assist.

Regarding the communication of the draw_style and similar properties: Currently they are stored on the actual constraints e.g. in class_defines.py in the SlvsAngle class. Such properties can be displayed with the class's draw_props method. Inside the gizmo you can access the properties with the constr object (e.g. constr.draw_style).

from cad_sketcher.

hlorus avatar hlorus commented on May 28, 2024

Closing as duplicate of #155

from cad_sketcher.

Related Issues (20)

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.